当前位置: 首页>>代码示例>>Java>>正文


Java ContentResolver.call方法代码示例

本文整理汇总了Java中android.content.ContentResolver.call方法的典型用法代码示例。如果您正苦于以下问题:Java ContentResolver.call方法的具体用法?Java ContentResolver.call怎么用?Java ContentResolver.call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.content.ContentResolver的用法示例。


在下文中一共展示了ContentResolver.call方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onReceive

import android.content.ContentResolver; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    final ContentResolver resolver = context.getContentResolver();

    final String action = intent.getAction();
    if (Intent.ACTION_PACKAGE_FULLY_REMOVED.equals(action)) {
        resolver.call(RecentsProvider.buildRecent(), RecentsProvider.METHOD_PURGE, null, null);

    } else if (Intent.ACTION_PACKAGE_DATA_CLEARED.equals(action)) {
        final Uri data = intent.getData();
        if (data != null) {
            final String packageName = data.getSchemeSpecificPart();
            resolver.call(RecentsProvider.buildRecent(), RecentsProvider.METHOD_PURGE_PACKAGE,
                    packageName, null);
        }
    }
}
 
开发者ID:medalionk,项目名称:simple-share-android,代码行数:18,代码来源:PackageReceiver.java

示例2: compressDocument

import android.content.ContentResolver; //导入方法依赖的package包/类
public static boolean compressDocument(ContentResolver resolver, Uri fromDocumentUri, ArrayList<String> fromDocumentIds) {
    final ContentProviderClient client = resolver.acquireUnstableContentProviderClient(
            fromDocumentUri.getAuthority());
    try {
        final Bundle in = new Bundle();
        in.putString(Document.COLUMN_DOCUMENT_ID, getDocumentId(fromDocumentUri));
        in.putParcelable(DocumentsContract.EXTRA_URI, fromDocumentUri);
        in.putStringArrayList(DocumentsContract.EXTRA_DOCUMENTS_COMPRESS, fromDocumentIds);
        resolver.call(fromDocumentUri, METHOD_COMPRESS_DOCUMENT, null, in);
        return true;
    } catch (Exception e) {
        Log.w(TAG, "Failed to compress document", e);
        return false;
    } finally {
        ContentProviderClientCompat.releaseQuietly(client);
    }
}
 
开发者ID:kranthi0987,项目名称:easyfilemanager,代码行数:18,代码来源:DocumentsContract.java

示例3: uncompressDocument

import android.content.ContentResolver; //导入方法依赖的package包/类
public static boolean uncompressDocument(ContentResolver resolver, Uri fromDocumentUri) {
    final ContentProviderClient client = resolver.acquireUnstableContentProviderClient(
            fromDocumentUri.getAuthority());
    try {
        final Bundle in = new Bundle();
        in.putString(Document.COLUMN_DOCUMENT_ID, getDocumentId(fromDocumentUri));
        in.putParcelable(DocumentsContract.EXTRA_URI, fromDocumentUri);

        resolver.call(fromDocumentUri, METHOD_UNCOMPRESS_DOCUMENT, null, in);
        return true;
    } catch (Exception e) {
        Log.w(TAG, "Failed to uncompress document", e);
        return false;
    } finally {
        ContentProviderClientCompat.releaseQuietly(client);
    }
}
 
开发者ID:kranthi0987,项目名称:easyfilemanager,代码行数:18,代码来源:DocumentsContract.java

示例4: call

import android.content.ContentResolver; //导入方法依赖的package包/类
public static Bundle call(String authority, Context context, String methodName, String arg, Bundle bundle) {
	Uri uri = Uri.parse("content://" + authority);
	ContentResolver contentResolver = context.getContentResolver();
	return contentResolver.call(uri, methodName, arg, bundle);
}
 
开发者ID:codehz,项目名称:container,代码行数:6,代码来源:ProviderCall.java

示例5: call

import android.content.ContentResolver; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
   public static Bundle call(ContentResolver resolver, ContentProviderClient client, Uri uri, String method, String arg, Bundle extras) throws Exception{
	if(Utils.hasJellyBeanMR1()){
    	return client.call(method, arg, extras);
	}
	else{
        return resolver.call(uri, method, arg, extras);
	}
}
 
开发者ID:kranthi0987,项目名称:easyfilemanager,代码行数:10,代码来源:ContentProviderClientCompat.java

示例6: transactProviderInstall

import android.content.ContentResolver; //导入方法依赖的package包/类
private static Object transactProviderInstall(String processName,ProviderInfo info){
    Bundle extras = new Bundle();
    extras.putParcelable(PROVIDER_INFO_KEY,info);
    ContentResolver contentResolver = RuntimeVariables.androidApplication.getContentResolver();
    Bundle bundle = contentResolver.call(accquireRemoteBridgeToken(processName),METHOD_INSTALLPROVIDER,"",extras);
    Object holder = bundle.getParcelable(PROVIDER_HOLDER_KEY);
    return holder;
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:9,代码来源:ContentProviderBridge.java

示例7: request

import android.content.ContentResolver; //导入方法依赖的package包/类
@Nullable
public BundledFontFamily request(@NonNull ContentResolver resolver) {
    Bundle data = new Bundle();
    data.setClassLoader(this.getClass().getClassLoader());
    data.putParcelable("data", this);

    Bundle result = resolver.call(
            Uri.parse("content://moe.shizuku.fontprovider"), "request", "bundled", data);
    if (result != null) {
        result.setClassLoader(this.getClass().getClassLoader());
        return result.getParcelable("data");
    }
    return null;
}
 
开发者ID:RikkaApps,项目名称:FontProvider,代码行数:15,代码来源:FontRequests.java

示例8: call

import android.content.ContentResolver; //导入方法依赖的package包/类
public static Bundle call(ContentResolver cr, String method) {
    return cr.call(CONTENT_URI, method, null, null);
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:4,代码来源:LauncherSettings.java


注:本文中的android.content.ContentResolver.call方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。