android.os.Bundle#putParcelableList ( )源码实例Demo

下面列出了android.os.Bundle#putParcelableList ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: android_9.0.0_r45   文件: CacheQuotaService.java
@Override
public void handleMessage(Message msg) {
    final int action = msg.what;
    switch (action) {
        case MSG_SEND_LIST:
            final Pair<RemoteCallback, List<CacheQuotaHint>> pair =
                    (Pair<RemoteCallback, List<CacheQuotaHint>>) msg.obj;
            List<CacheQuotaHint> processed = onComputeCacheQuotaHints(pair.second);
            final Bundle data = new Bundle();
            data.putParcelableList(REQUEST_LIST_KEY, processed);

            final RemoteCallback callback = pair.first;
            callback.sendResult(data);
            break;
        default:
            Log.w(TAG, "Handling unknown message: " + action);
    }
}
 
public void onInstantAppResolveInfo(List<InstantAppResolveInfo> resolveInfo) {
    final Bundle data = new Bundle();
    data.putParcelableList(EXTRA_RESOLVE_INFO, resolveInfo);
    data.putInt(EXTRA_SEQUENCE, mSequence);
    try {
        mCallback.sendResult(data);
    } catch (RemoteException e) {
    }
}
 
源代码3 项目: android_9.0.0_r45   文件: MediaStore.java
private static Uri getDocumentUri(
        ContentResolver resolver, String path, List<UriPermission> uriPermissions)
        throws RemoteException {

    try (ContentProviderClient client = resolver.acquireUnstableContentProviderClient(
            DocumentsContract.EXTERNAL_STORAGE_PROVIDER_AUTHORITY)) {
        final Bundle in = new Bundle();
        in.putParcelableList(
                DocumentsContract.EXTERNAL_STORAGE_PROVIDER_AUTHORITY + ".extra.uriPermissions",
                uriPermissions);
        final Bundle out = client.call("getDocumentId", path, in);
        return out.getParcelable(DocumentsContract.EXTRA_URI);
    }
}