android.os.Bundle.getSerializable()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(357)

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

Bundle.getSerializable介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

Bundle bundle = this.getIntent().getExtras();
if(bundle!=null){
 Hash_Map= bundle.getSerializable("HashMap");

代码示例来源:origin: crazycodeboy/TakePhoto

@Override
public void onCreate(Bundle savedInstanceState) {
  if (savedInstanceState != null) {
    cropOptions = (CropOptions) savedInstanceState.getSerializable("cropOptions");
    takePhotoOptions = (TakePhotoOptions) savedInstanceState.getSerializable("takePhotoOptions");
    showCompressDialog = savedInstanceState.getBoolean("showCompressDialog");
    outPutUri = savedInstanceState.getParcelable("outPutUri");
    tempUri = savedInstanceState.getParcelable("tempUri");
    compressConfig = (CompressConfig) savedInstanceState.getSerializable("compressConfig");
  }
}

代码示例来源:origin: stackoverflow.com

Intent intent = this.getIntent();
Bundle bundle = intent.getExtras();

List<Thumbnail> thumbs=
        (List<Thumbnail>)bundle.getSerializable("value");

代码示例来源: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: smuyyh/BookReader

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle state) {
  if ((state != null) && state.containsKey(BUNDLE_POSITION)
      && state.containsKey(BUNDLE_BOOK)) {
    mPosition = state.getInt(BUNDLE_POSITION);
    mBook = (Book) state.getSerializable(BUNDLE_BOOK);
    mEpubFileName = state.getString(BUNDLE_EPUB_FILE_NAME);
    mIsSmilAvailable = state.getBoolean(BUNDLE_IS_SMIL_AVAILABLE);
  }
  return super.onCreateView(inflater, container, state);
}

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

public static AccessTokenSource getSource(Bundle bundle) {
  Validate.notNull(bundle, "bundle");
  if (bundle.containsKey(TOKEN_SOURCE_KEY)) {
    return (AccessTokenSource) bundle.getSerializable(TOKEN_SOURCE_KEY);
  } else {
    boolean isSSO = bundle.getBoolean(IS_SSO_KEY);
    return isSSO ? AccessTokenSource.FACEBOOK_APPLICATION_WEB : AccessTokenSource.WEB_VIEW;
  }
}

代码示例来源:origin: k9mail/k-9

public void onRestoreInstanceState(Bundle savedInstanceState) {
  quotedHtmlContent = (InsertableHtmlContent) savedInstanceState.getSerializable(STATE_KEY_HTML_QUOTE);
  if (quotedHtmlContent != null && quotedHtmlContent.getQuotedContent() != null) {
    // we don't have the part here, but inline-displayed images are cached by the webview
    view.setQuotedHtml(quotedHtmlContent.getQuotedContent(), null);
  }
  quotedTextFormat = (SimpleMessageFormat) savedInstanceState.getSerializable(
      STATE_KEY_QUOTED_TEXT_FORMAT);
  forcePlainText = savedInstanceState.getBoolean(STATE_KEY_FORCE_PLAIN_TEXT);
  showOrHideQuotedText(
      (QuotedTextMode) savedInstanceState.getSerializable(STATE_KEY_QUOTED_TEXT_MODE));
}

代码示例来源: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);
    this.showOutline = bundle.getBoolean(OutlineableView.KEY);
    this.bootstrapSize = bundle.getFloat(BootstrapSizeView.KEY);
    Serializable direction = bundle.getSerializable(KEY_DIRECTION);
    if (direction instanceof ExpandDirection) {
      expandDirection = (ExpandDirection) direction;
    }
  }
  super.onRestoreInstanceState(state);
}

代码示例来源:origin: Bearded-Hen/Android-Bootstrap

@Override public void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    Bundle bundle = (Bundle) state;
    this.roundable = bundle.getBoolean(RoundableView.KEY);
    Serializable heading = bundle.getSerializable(BootstrapHeading.KEY);
    if (heading instanceof BootstrapHeading) {
      bootstrapHeading = (BootstrapHeading) heading;
    }
    state = bundle.getParcelable(TAG);
  }
  super.onRestoreInstanceState(state);
  updateBootstrapState();
}

代码示例来源:origin: pockethub/PocketHub

@SuppressWarnings("unchecked")
@Override
public void onActivityCreated(Bundle savedInstanceState) {
  filterData = (Map<String, Object>) getArguments().getSerializable(ARG_FILTER);
  super.onActivityCreated(savedInstanceState);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onPause() {
 if (loaded) {
  new SaveThread(editor.getText().toString(),
    (File)getArguments().getSerializable(KEY_FILE)).start();
 }
 super.onPause();
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onPause() {
 if (loaded) {
  new SaveThread(editor.getText().toString(),
    (File)getArguments().getSerializable(KEY_FILE)).start();
 }
 super.onPause();
}

代码示例来源:origin: Bearded-Hen/Android-Bootstrap

@Override public void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    Bundle bundle = (Bundle) state;
    this.hasBorder = bundle.getBoolean(BorderView.KEY_DISPLAYED);
    this.bootstrapSize = bundle.getFloat(BootstrapSizeView.KEY);
    Serializable brand = bundle.getSerializable(BootstrapBrandView.KEY);
    if (brand instanceof BootstrapBrand) {
      this.bootstrapBrand = (BootstrapBrand) brand;
    }
    state = bundle.getParcelable(TAG);
  }
  super.onRestoreInstanceState(state);
  updateImageState();
}

代码示例来源:origin: Bearded-Hen/Android-Bootstrap

@Override public void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    Bundle bundle = (Bundle) state;
    this.rounded = bundle.getBoolean(RoundableView.KEY);
    this.bootstrapSize = bundle.getFloat(BootstrapSizeView.KEY);
    Serializable brand = bundle.getSerializable(BootstrapBrand.KEY);
    if (brand instanceof BootstrapBrand) {
      bootstrapBrand = (BootstrapBrand) brand;
    }
    state = bundle.getParcelable(TAG);
  }
  super.onRestoreInstanceState(state);
  updateBootstrapState();
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
 super.onViewCreated(view, savedInstanceState);
 if (!loaded) {
  loadTask=new LoadTextTask();
  loadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,
    (File)getArguments().getSerializable(KEY_FILE));
 }
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
 super.onViewCreated(view, savedInstanceState);
 if (!loaded) {
  loadTask=new LoadTextTask();
  loadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,
    (File)getArguments().getSerializable(KEY_FILE));
 }
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onStop() {
 if (loaded) {
  new SaveThread(editor.getText().toString(),
    (File)getArguments().getSerializable(KEY_FILE)).start();
 }
 super.onStop();
}

代码示例来源:origin: smuyyh/BookReader

@Override
public void initDatas() {
  activity = (ReadEPubActivity) getActivity();
  mPosition = getArguments().getInt(BUNDLE_POSITION);
  mBook = (Book) getArguments().getSerializable(BUNDLE_BOOK);
  mEpubFileName = getArguments().getString(BUNDLE_EPUB_FILE_NAME);
  mIsSmilAvailable = getArguments().getBoolean(BUNDLE_IS_SMIL_AVAILABLE);
}

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

@Override
protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 if (savedInstanceState != null) {
  assertThat(savedInstanceState.getSerializable("test")).isNotNull();
 }
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
 super.onViewCreated(view, savedInstanceState);
 if (!loaded) {
  loadTask=new LoadTextTask();
  loadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,
    (File)getArguments().getSerializable(KEY_FILE));
 }
}

相关文章

Bundle类方法