當前位置: 首頁>>代碼示例>>Java>>正文


Java ContentProviderClient.call方法代碼示例

本文整理匯總了Java中android.content.ContentProviderClient.call方法的典型用法代碼示例。如果您正苦於以下問題:Java ContentProviderClient.call方法的具體用法?Java ContentProviderClient.call怎麽用?Java ContentProviderClient.call使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.content.ContentProviderClient的用法示例。


在下文中一共展示了ContentProviderClient.call方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isChildDocument

import android.content.ContentProviderClient; //導入方法依賴的package包/類
public static boolean isChildDocument(ContentProviderClient client, Uri parentDocumentUri,
                                      Uri childDocumentUri) throws RemoteException {

    final Bundle in = new Bundle();
    in.putParcelable(DocumentsContract.EXTRA_URI, parentDocumentUri);
    in.putParcelable(DocumentsContract.EXTRA_TARGET_URI, childDocumentUri);

    final Bundle out = client.call(METHOD_IS_CHILD_DOCUMENT, null, in);
    if (out == null) {
        throw new RemoteException("Failed to get a reponse from isChildDocument query.");
    }
    if (!out.containsKey(DocumentsContract.EXTRA_RESULT)) {
        throw new RemoteException("Response did not include result field..");
    }
    return out.getBoolean(DocumentsContract.EXTRA_RESULT);
}
 
開發者ID:medalionk,項目名稱:simple-share-android,代碼行數:17,代碼來源:DocumentsContract.java

示例2: createDocument

import android.content.ContentProviderClient; //導入方法依賴的package包/類
public static Uri createDocument(ContentProviderClient client, Uri parentDocumentUri,
                                 String mimeType, String displayName) throws Exception {
    final Bundle in = new Bundle();
    in.putParcelable(DocumentsContract.EXTRA_URI, parentDocumentUri);
    in.putString(DocumentsContract.Document.COLUMN_MIME_TYPE, mimeType);
    in.putString(DocumentsContract.Document.COLUMN_DISPLAY_NAME, displayName);

    final Bundle out = client.call(METHOD_CREATE_DOCUMENT, null, in);
    return out.getParcelable(DocumentsContract.EXTRA_URI);
}
 
開發者ID:kranthi0987,項目名稱:easyfilemanager,代碼行數:11,代碼來源:DocumentsContract.java

示例3: renameDocument

import android.content.ContentProviderClient; //導入方法依賴的package包/類
public static Uri renameDocument(ContentProviderClient client, Uri documentUri,
                                 String displayName) throws RemoteException {
    final Bundle in = new Bundle();
    in.putParcelable(DocumentsContract.EXTRA_URI, documentUri);
    in.putString(DocumentsContract.Document.COLUMN_DISPLAY_NAME, displayName);

    final Bundle out = client.call(METHOD_RENAME_DOCUMENT, null, in);
    final Uri outUri = out.getParcelable(DocumentsContract.EXTRA_URI);
    return (outUri != null) ? outUri : documentUri;
}
 
開發者ID:medalionk,項目名稱:simple-share-android,代碼行數:11,代碼來源:DocumentsContract.java

示例4: copyDocument

import android.content.ContentProviderClient; //導入方法依賴的package包/類
public static Uri copyDocument(ContentProviderClient client, Uri sourceDocumentUri,
                               Uri targetParentDocumentUri) throws RemoteException {
    final Bundle in = new Bundle();
    in.putParcelable(DocumentsContract.EXTRA_URI, sourceDocumentUri);
    in.putParcelable(DocumentsContract.EXTRA_TARGET_URI, targetParentDocumentUri);

    final Bundle out = client.call(METHOD_COPY_DOCUMENT, null, in);
    return out.getParcelable(DocumentsContract.EXTRA_URI);
}
 
開發者ID:medalionk,項目名稱:simple-share-android,代碼行數:10,代碼來源:DocumentsContract.java

示例5: moveDocument

import android.content.ContentProviderClient; //導入方法依賴的package包/類
public static Uri moveDocument(ContentProviderClient client, Uri sourceDocumentUri,
        Uri sourceParentDocumentUri, Uri targetParentDocumentUri) throws RemoteException {
    final Bundle in = new Bundle();
    in.putParcelable(DocumentsContract.EXTRA_URI, sourceDocumentUri);
    in.putParcelable(DocumentsContract.EXTRA_PARENT_URI, sourceParentDocumentUri);
    in.putParcelable(DocumentsContract.EXTRA_TARGET_URI, targetParentDocumentUri);

    final Bundle out = client.call(METHOD_MOVE_DOCUMENT, null, in);
    return out.getParcelable(DocumentsContract.EXTRA_URI);
}
 
開發者ID:medalionk,項目名稱:simple-share-android,代碼行數:11,代碼來源:DocumentsContract.java

示例6: removeDocument

import android.content.ContentProviderClient; //導入方法依賴的package包/類
public static void removeDocument(ContentProviderClient client, Uri documentUri,
        Uri parentDocumentUri) throws RemoteException {
    final Bundle in = new Bundle();
    in.putParcelable(DocumentsContract.EXTRA_URI, documentUri);
    in.putParcelable(DocumentsContract.EXTRA_PARENT_URI, parentDocumentUri);

    client.call(METHOD_REMOVE_DOCUMENT, null, in);
}
 
開發者ID:kranthi0987,項目名稱:easyfilemanager,代碼行數:9,代碼來源:DocumentsContract.java

示例7: call

import android.content.ContentProviderClient; //導入方法依賴的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

示例8: call

import android.content.ContentProviderClient; //導入方法依賴的package包/類
public static Bundle call(Context context, Uri uri, String method, String arg, Bundle extras) {
    if (VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
        return context.getContentResolver().call(uri, method, arg, extras);
    }
    ContentProviderClient client = crazyAcquireContentProvider(context, uri);
    Bundle res = null;
    try {
        res = client.call(method, arg, extras);
    } catch (RemoteException e) {
        e.printStackTrace();
    } finally {
        releaseQuietly(client);
    }
    return res;
}
 
開發者ID:7763sea,項目名稱:VirtualHook,代碼行數:16,代碼來源:ContentProviderCompat.java

示例9: deleteDocument

import android.content.ContentProviderClient; //導入方法依賴的package包/類
public static void deleteDocument(ContentProviderClient client, Uri documentUri)
        throws RemoteException {
    final Bundle in = new Bundle();
    in.putParcelable(DocumentsContract.EXTRA_URI, documentUri);

    client.call(METHOD_DELETE_DOCUMENT, null, in);
}
 
開發者ID:gigabytedevelopers,項目名稱:FireFiles,代碼行數:8,代碼來源:DocumentsContract.java

示例10: call

import android.content.ContentProviderClient; //導入方法依賴的package包/類
@TargetApi(VERSION_CODES.JELLY_BEAN_MR1)
@Override
public Bundle call(String method, String arg, Bundle extras) {
    String targetAuthority = extras != null ? extras.getString(Env.EXTRA_TARGET_AUTHORITY) : null;
    String targetMethod = extras != null ? extras.getString(Env.EXTRA_TARGET_AUTHORITY) : null;
    if (!TextUtils.isEmpty(targetMethod) && !TextUtils.equals(targetMethod, method)) {
        ContentProviderClient client = getContentProviderClient(targetAuthority);
        try {
            return client.call(targetMethod, arg, extras);
        } catch (RemoteException e) {
            handleExpcetion(e);
        }
    }
    return super.call(method, arg, extras);
}
 
開發者ID:amikey,項目名稱:DroidPlugin,代碼行數:16,代碼來源:AbstractContentProviderStub.java


注:本文中的android.content.ContentProviderClient.call方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。