android.os.Parcel.readBundle()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(206)

本文整理了Java中android.os.Parcel.readBundle()方法的一些代码示例,展示了Parcel.readBundle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parcel.readBundle()方法的具体详情如下:
包路径:android.os.Parcel
类名称:Parcel
方法名:readBundle

Parcel.readBundle介绍

[英]Read and return a new Bundle object from the parcel at the current dataPosition(). Returns null if the previously written Bundle object was null.
[中]

代码示例

代码示例来源:origin: facebook/facebook-android-sdk

ShareMedia(final Parcel in) {
  this.params = in.readBundle();
}

代码示例来源:origin: facebook/facebook-android-sdk

ShareOpenGraphValueContainer(final Parcel in) {
  this.bundle = in.readBundle(Builder.class.getClassLoader());
}

代码示例来源:origin: mxn21/FlowingDrawer

@SuppressLint("ParcelClassLoader")
SavedState(Parcel in) {
  super(in);
  mState = in.readBundle();
}

代码示例来源:origin: android-hacker/VirtualXposed

SyncExtras(Parcel in) {
  this.extras = in.readBundle(getClass().getClassLoader());
}

代码示例来源:origin: facebook/facebook-android-sdk

CameraEffectArguments(final Parcel in) {
  params = in.readBundle(getClass().getClassLoader());
}

代码示例来源:origin: seven332/EhViewer

public SavedState(Parcel source) {
  super(source);
  isDialogShowing = source.readInt() == 1;
  dialogBundle = source.readBundle(DialogPreference.class.getClassLoader());
}

代码示例来源:origin: facebook/facebook-android-sdk

CameraEffectTextures(final Parcel in) {
  textures = in.readBundle(getClass().getClassLoader());
}

代码示例来源:origin: android-hacker/VirtualXposed

protected ServiceComponent(Parcel src) {
    info = src.readParcelable(ActivityInfo.class.getClassLoader());
    className = src.readString();
    metaData = src.readBundle(Bundle.class.getClassLoader());
    int N = src.readInt();
    intents = new ArrayList<>(N);
    while (N-- > 0) {
      intents.add(new ServiceIntentInfo(src));
    }
  }
}

代码示例来源:origin: android-hacker/VirtualXposed

protected InstrumentationComponent(Parcel src) {
    info = src.readParcelable(ActivityInfo.class.getClassLoader());
    className = src.readString();
    metaData = src.readBundle(Bundle.class.getClassLoader());
    int N = src.readInt();
    intents = new ArrayList<>(N);
    while (N-- > 0) {
      intents.add(new IntentInfo(src));
    }
  }
}

代码示例来源:origin: android-hacker/VirtualXposed

protected PermissionGroupComponent(Parcel src) {
    info = src.readParcelable(ActivityInfo.class.getClassLoader());
    className = src.readString();
    metaData = src.readBundle(Bundle.class.getClassLoader());
    int N = src.readInt();
    intents = new ArrayList<>(N);
    while (N-- > 0) {
      intents.add(new IntentInfo(src));
    }
  }
}

代码示例来源:origin: aa112901/remusic

@Override
public FolderInfo createFromParcel(Parcel source) {
  FolderInfo info = new FolderInfo();
  Bundle bundle = source.readBundle();
  info.folder_name = bundle.getString(KEY_FOLDER_NAME);
  info.folder_path = bundle.getString(KEY_FOLDER_PATH);
  info.folder_sort = bundle.getString(KEY_FOLDER_SORT);
  info.folder_count = bundle.getInt(KEY_FOLDER_FILE_COUNT);
  return info;
}

代码示例来源:origin: android-hacker/VirtualXposed

protected ActivityComponent(Parcel src) {
    info = src.readParcelable(ActivityInfo.class.getClassLoader());
    className = src.readString();
    metaData = src.readBundle(Bundle.class.getClassLoader());
    int N = src.readInt();
    intents = new ArrayList<>(N);
    while (N-- > 0) {
      intents.add(new ActivityIntentInfo(src));
    }
  }
}

代码示例来源:origin: android-hacker/VirtualXposed

protected PermissionComponent(Parcel src) {
    info = src.readParcelable(ActivityInfo.class.getClassLoader());
    className = src.readString();
    metaData = src.readBundle(Bundle.class.getClassLoader());
    int N = src.readInt();
    intents = new ArrayList<>(N);
    while (N-- > 0) {
      intents.add(new IntentInfo(src));
    }
  }
}

代码示例来源:origin: android-hacker/VirtualXposed

protected ProviderComponent(Parcel src) {
    info = src.readParcelable(ActivityInfo.class.getClassLoader());
    className = src.readString();
    metaData = src.readBundle(Bundle.class.getClassLoader());
    int N = src.readInt();
    intents = new ArrayList<>(N);
    while (N-- > 0) {
      intents.add(new ProviderIntentInfo(src));
    }
  }
}

代码示例来源:origin: aa112901/remusic

@Override
public ArtistInfo createFromParcel(Parcel source) {
  Bundle bundle = source.readBundle();
  ArtistInfo info = new ArtistInfo();
  info.artist_name = bundle.getString(KEY_ARTIST_NAME);
  info.number_of_tracks = bundle.getInt(KEY_NUMBER_OF_TRACKS);
  info.artist_id = bundle.getLong(KEY_ARTIST_ID);
  info.artist_sort = bundle.getString(KEY_ARTIST_SORT);
  return info;
}

代码示例来源:origin: android-hacker/VirtualXposed

protected PendingResultData(Parcel in) {
  this.mType = in.readInt();
  this.mOrderedHint = in.readByte() != 0;
  this.mInitialStickyHint = in.readByte() != 0;
  this.mToken = in.readStrongBinder();
  this.mSendingUser = in.readInt();
  this.mFlags = in.readInt();
  this.mResultCode = in.readInt();
  this.mResultData = in.readString();
  this.mResultExtras = in.readBundle();
  this.mAbortBroadcast = in.readByte() != 0;
  this.mFinished = in.readByte() != 0;
}

代码示例来源:origin: aa112901/remusic

@Override
public AlbumInfo createFromParcel(Parcel source) {
  AlbumInfo info = new AlbumInfo();
  Bundle bundle = source.readBundle();
  info.album_name = bundle.getString(KEY_ALBUM_NAME);
  info.album_art = bundle.getString(KEY_ALBUM_ART);
  info.number_of_songs = bundle.getInt(KEY_NUMBER_OF_SONGS);
  info.album_id = bundle.getInt(KEY_ALBUM_ID);
  info.album_artist = bundle.getString(KEY_ALBUM_ARTIST);
  info.album_sort = bundle.getString(KEY_ALBUM_SORT);
  return info;
}

代码示例来源:origin: dinuscxj/RecyclerRefreshLayout

private TabInfo(Parcel parcel) throws ParcelFormatException {
  try {
    this.title = parcel.readString();
    this.arguments = parcel.readBundle();
    this.fragmentClass = getClass().getClassLoader().loadClass(parcel.readString());
  } catch (Exception e) {
    throw new ParcelFormatException();
  }
}

代码示例来源:origin: robolectric/robolectric

@Override
public VisualVoicemailSms createFromParcel(Parcel in) {
 VisualVoicemailSms sms = Shadow.newInstanceOf(VisualVoicemailSms.class);
 ShadowVisualVoicemailSms shadowSms = Shadow.extract(sms);
 shadowSms
   .setPhoneAccountHandle(in.readParcelable(PhoneAccountHandle.class.getClassLoader()))
   .setPrefix(in.readString())
   .setFields(in.readBundle())
   .setMessageBody(in.readString());
 return sms;
}

代码示例来源:origin: robolectric/robolectric

@Test
public void testReadWriteBundle() {
 Bundle b1 = new Bundle();
 b1.putString("hello", "world");
 parcel.writeBundle(b1);
 parcel.setDataPosition(0);
 Bundle b2 = parcel.readBundle();
 assertEquals("world", b2.getString("hello"));
 parcel.setDataPosition(0);
 parcel.writeBundle(b1);
 parcel.setDataPosition(0);
 b2 = parcel.readBundle(null /* ClassLoader */);
 assertEquals("world", b2.getString("hello"));
}

相关文章

Parcel类方法