當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。