当前位置: 首页>>代码示例>>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;未经允许,请勿转载。