本文整理了Java中android.os.Bundle.getParcelable()
方法的一些代码示例,展示了Bundle.getParcelable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bundle.getParcelable()
方法的具体详情如下:
包路径:android.os.Bundle
类名称:Bundle
方法名:getParcelable
暂无
代码示例来源:origin: stackoverflow.com
Bundle data = getIntent().getExtras();
Student student = (Student) data.getParcelable("student");
代码示例来源:origin: pockethub/PocketHub
/**
* Get selected user from results bundle
*
* @param arguments
* @return user
*/
public static User getSelected(Bundle arguments) {
return (User) arguments.getParcelable(ARG_SELECTED);
}
代码示例来源:origin: pockethub/PocketHub
/**
* Get selected reference from results bundle
*
* @param arguments
* @return user
*/
public static GitReference getSelected(Bundle arguments) {
return (GitReference) arguments.getParcelable(ARG_SELECTED);
}
代码示例来源:origin: stackoverflow.com
Bundle b = this.getIntent().getExtras();
if (b != null)
mCurrentListing = b.getParcelable(Constants.CUSTOM_LISTING);
代码示例来源:origin: androidannotations/androidannotations
@Override
public void onRestoreInstanceState(Parcelable state) {
Bundle bundle = (Bundle) state;
stringState = bundle.getString("stringState");
beanState = bundle.getParcelable("beanState");
}
}
代码示例来源:origin: umano/AndroidSlidingUpPanel
@Override
public void onRestoreInstanceState(Parcelable state) {
if (state instanceof Bundle) {
Bundle bundle = (Bundle) state;
mSlideState = (PanelState) bundle.getSerializable(SLIDING_STATE);
mSlideState = mSlideState == null ? DEFAULT_SLIDE_STATE : mSlideState;
state = bundle.getParcelable("superState");
}
super.onRestoreInstanceState(state);
}
代码示例来源:origin: Bearded-Hen/Android-Bootstrap
@Override public void onRestoreInstanceState(Parcelable state) {
if (state instanceof Bundle) {
Bundle bundle = (Bundle) state;
this.roundedCorners = bundle.getBoolean(RoundableView.KEY);
state = bundle.getParcelable(TAG);
}
super.onRestoreInstanceState(state);
}
代码示例来源:origin: pockethub/PocketHub
@Override
public void onActivityCreated(Bundle savedInstanceState) {
org = getArguments().getParcelable("org");
if (org == null && savedInstanceState != null) {
org = savedInstanceState.getParcelable(EXTRA_USER);
}
setEmptyText(R.string.no_members);
super.onActivityCreated(savedInstanceState);
}
代码示例来源:origin: H07000223/FlycoTabLayout
@Override
protected void onRestoreInstanceState(Parcelable state) {
if (state instanceof Bundle) {
Bundle bundle = (Bundle) state;
mCurrentTab = bundle.getInt("mCurrentTab");
state = bundle.getParcelable("instanceState");
if (mCurrentTab != 0 && mTabsContainer.getChildCount() > 0) {
updateTabSelection(mCurrentTab);
}
}
super.onRestoreInstanceState(state);
}
代码示例来源:origin: H07000223/FlycoTabLayout
@Override
protected void onRestoreInstanceState(Parcelable state) {
if (state instanceof Bundle) {
Bundle bundle = (Bundle) state;
mCurrentTab = bundle.getInt("mCurrentTab");
state = bundle.getParcelable("instanceState");
if (mCurrentTab != 0 && mTabsContainer.getChildCount() > 0) {
updateTabSelection(mCurrentTab);
}
}
super.onRestoreInstanceState(state);
}
代码示例来源:origin: zhihu/Matisse
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
Context context = mContext.get();
if (context == null) {
return null;
}
Album album = args.getParcelable(ARGS_ALBUM);
if (album == null) {
return null;
}
return AlbumMediaLoader.newInstance(context, album,
album.isAll() && args.getBoolean(ARGS_ENABLE_CAPTURE, false));
}
代码示例来源:origin: robolectric/robolectric
public Bitmap getBigPicture() {
if (RuntimeEnvironment.getApiLevel() >= Build.VERSION_CODES.N) {
return realNotification.extras.getParcelable(Notification.EXTRA_PICTURE);
} else {
ImageView imageView = (ImageView) applyBigContentView().findViewById(getInternalResourceId("big_picture"));
return imageView != null && imageView.getDrawable() != null
? ((BitmapDrawable) imageView.getDrawable()).getBitmap() : null;
}
}
代码示例来源:origin: roughike/BottomBar
@Override
public void onRestoreInstanceState(Parcelable state) {
if (state instanceof Bundle) {
Bundle bundle = (Bundle) state;
restoreState(bundle);
state = bundle.getParcelable("superstate");
}
super.onRestoreInstanceState(state);
}
代码示例来源:origin: roughike/BottomBar
@Override
public void onRestoreInstanceState(Parcelable state) {
if (state instanceof Bundle) {
Bundle bundle = (Bundle) state;
restoreState(bundle);
state = bundle.getParcelable("superstate");
}
super.onRestoreInstanceState(state);
}
代码示例来源:origin: H07000223/FlycoTabLayout
@Override
protected void onRestoreInstanceState(Parcelable state) {
if (state instanceof Bundle) {
Bundle bundle = (Bundle) state;
mCurrentTab = bundle.getInt("mCurrentTab");
state = bundle.getParcelable("instanceState");
if (mCurrentTab != 0 && mTabsContainer.getChildCount() > 0) {
updateTabSelection(mCurrentTab);
scrollToCurrentTab();
}
}
super.onRestoreInstanceState(state);
}
代码示例来源:origin: pockethub/PocketHub
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
sharedPreferences = getActivity().getPreferences(Context.MODE_PRIVATE);
setOrg((User) getArguments().getParcelable("org"));
}
代码示例来源:origin: pockethub/PocketHub
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle appData = getActivity().getIntent().getBundleExtra(APP_DATA);
if (appData != null) {
repository = appData.getParcelable(EXTRA_REPOSITORY);
}
}
代码示例来源:origin: pockethub/PocketHub
@Override
public void onActivityCreated(Bundle savedInstanceState) {
if (getActivity() instanceof OrganizationSelectionProvider) {
org = ((OrganizationSelectionProvider) getActivity()).addListener(this);
}
if (getArguments() != null && getArguments().containsKey("org")) {
org = getArguments().getParcelable("org");
}
if (org == null && savedInstanceState != null) {
org = (User) savedInstanceState.get(EXTRA_USER);
}
super.onActivityCreated(savedInstanceState);
}
代码示例来源:origin: pockethub/PocketHub
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle args = getArguments();
base = args.getString(EXTRA_BASE);
repository = args.getParcelable(EXTRA_REPOSITORY);
mainSection.add(commitSection);
mainSection.add(filesSection);
mainSection.add(commentSection);
adapter.add(mainSection);
adapter.setOnItemClickListener(this);
}
代码示例来源:origin: robolectric/robolectric
@Test
public void addAccount_noActivitySpecified() throws Exception {
shadowOf(am).addAuthenticator("google.com");
AccountManagerFuture<Bundle> result = am.addAccount("google.com", "auth_token_type", null, null, null, null, null);
Bundle resultBundle = result.getResult();
assertThat((Intent) resultBundle.getParcelable(AccountManager.KEY_INTENT)).isNotNull();
}
内容来源于网络,如有侵权,请联系作者删除!