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

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

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

Bundle.putParcelableArrayList介绍

暂无

代码示例

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

public I parcelableArrayListArg(String key, ArrayList<? extends Parcelable> value) {
  args.putParcelableArrayList(key, value);
  return (I) this;
}

代码示例来源:origin: ogaclejapan/SmartTabLayout

/**
 * Inserts a List of Parcelable values into the mapping of this Bundle,
 * replacing any existing value for the given key.  Either key or value may
 * be null.
 *
 * @param key   a String, or null
 * @param value an ArrayList of Parcelable objects, or null
 */
public Bundler putParcelableArrayList(String key,
  ArrayList<? extends Parcelable> value) {
 bundle.putParcelableArrayList(key, value);
 return this;
}

代码示例来源:origin: ogaclejapan/SmartTabLayout

/**
 * Inserts a List of Parcelable values into the mapping of this Bundle,
 * replacing any existing value for the given key.  Either key or value may
 * be null.
 *
 * @param key   a String, or null
 * @param value an ArrayList of Parcelable objects, or null
 */
public Bundler putParcelableArrayList(String key,
  ArrayList<? extends Parcelable> value) {
 bundle.putParcelableArrayList(key, value);
 return this;
}

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

/**
 * Sets an array of object values in the object.
 * @param key The key for the value.
 * @param value The value.
 * @return The builder.
 */
public E putObjectArrayList(
    final String key,
    @Nullable final ArrayList<ShareOpenGraphObject> value) {
  this.bundle.putParcelableArrayList(key, value);
  return (E)this;
}

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

/**
 * Sets an array of photo values in the object.
 * @param key The key for the value.
 * @param value The value.
 * @return The builder.
 */
public E putPhotoArrayList(final String key, @Nullable final ArrayList<SharePhoto> value) {
  this.bundle.putParcelableArrayList(key, value);
  return (E) this;
}

代码示例来源:origin: zhihu/Matisse

public void onSaveInstanceState(Bundle outState) {
  outState.putParcelableArrayList(STATE_SELECTION, new ArrayList<>(mItems));
  outState.putInt(STATE_COLLECTION_TYPE, mCollectionType);
}

代码示例来源:origin: zhihu/Matisse

public Bundle getDataWithBundle() {
  Bundle bundle = new Bundle();
  bundle.putParcelableArrayList(STATE_SELECTION, new ArrayList<>(mItems));
  bundle.putInt(STATE_COLLECTION_TYPE, mCollectionType);
  return bundle;
}

代码示例来源:origin: Yalantis/uCrop

/**
 * Pass an ordered list of desired aspect ratios that should be available for a user.
 *
 * @param selectedByDefault - index of aspect ratio option that is selected by default (starts with 0).
 * @param aspectRatio       - list of aspect ratio options that are available to user
 */
public void setAspectRatioOptions(int selectedByDefault, AspectRatio... aspectRatio) {
  if (selectedByDefault > aspectRatio.length) {
    throw new IllegalArgumentException(String.format(Locale.US,
        "Index [selectedByDefault = %d] cannot be higher than aspect ratio options count [count = %d].",
        selectedByDefault, aspectRatio.length));
  }
  mOptionBundle.putInt(EXTRA_ASPECT_RATIO_SELECTED_BY_DEFAULT, selectedByDefault);
  mOptionBundle.putParcelableArrayList(EXTRA_ASPECT_RATIO_OPTIONS, new ArrayList<Parcelable>(Arrays.asList(aspectRatio)));
}

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

private static Bundle create(
  ShareMediaContent mediaContent,
  List<Bundle> mediaInfos,
  boolean dataErrorsFatal) {
  Bundle params = createBaseParameters(mediaContent, dataErrorsFatal);
  params.putParcelableArrayList(ShareConstants.MEDIA, new ArrayList<>(mediaInfos));
  return params;
}

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

public class QueryService extends IntentService {
  protected void onHandleIntent(Intent intent) {
    final ResultReceiver receiver = intent.getParcelableExtra("receiver");
    String command = intent.getStringExtra("command");
    Bundle b = new Bundle();
    if(command.equals("query") {
      receiver.send(STATUS_RUNNING, Bundle.EMPTY);
      try {
        // get some data or something           
        b.putParcelableArrayList("results", results);
        receiver.send(STATUS_FINISHED, b)
      } catch(Exception e) {
        b.putString(Intent.EXTRA_TEXT, e.toString());
        receiver.send(STATUS_ERROR, b);
      }    
    }
  }
}

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

public static AddNetPlaylistDialog newInstance(ArrayList<MusicInfo> list) {
  AddNetPlaylistDialog dialog = new AddNetPlaylistDialog();
  Bundle bundle = new Bundle();
  bundle.putString("author", "local");
  bundle.putParcelableArrayList("songs", list);
  dialog.setArguments(bundle);
  return dialog;
}

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

public static AddNetPlaylistDialog newInstance(ArrayList<MusicInfo> list, String author) {
  AddNetPlaylistDialog dialog = new AddNetPlaylistDialog();
  Bundle bundle = new Bundle();
  bundle.putString("author", author);
  bundle.putParcelableArrayList("songs", list);
  dialog.setArguments(bundle);
  return dialog;
}

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

public void onSaveInstanceState(Bundle outState) {
  outState.putString(STATE_KEY_WAITING_FOR_ATTACHMENTS, actionToPerformAfterWaiting.name());
  outState.putParcelableArrayList(STATE_KEY_ATTACHMENTS, createAttachmentList());
  outState.putInt(STATE_KEY_NEXT_LOADER_ID, nextLoaderId);
}

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

public static SearchMusicFragment newInstance(ArrayList<SearchSongInfo> list) {
  SearchMusicFragment fragment = new SearchMusicFragment();
  Bundle bundle = new Bundle();
  bundle.putParcelableArrayList("searchMusic", list);
  fragment.setArguments(bundle);
  return fragment;
}

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

public static SearchArtistFragment newInstance(ArrayList<SearchArtistInfo> list) {
  SearchArtistFragment fragment = new SearchArtistFragment();
  Bundle bundle = new Bundle();
  bundle.putParcelableArrayList("searchArtist", list);
  fragment.setArguments(bundle);
  return fragment;
}

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

public static SearchAlbumFragment newInstance(ArrayList<SearchAlbumInfo> list) {
  SearchAlbumFragment fragment = new SearchAlbumFragment();
  Bundle bundle = new Bundle();
  bundle.putParcelableArrayList("searchAlbum", list);
  fragment.setArguments(bundle);
  return fragment;
}

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

public static Fragment getInstance(ArrayList<MusicInfo> mList) {
  ArtistInfoMusicFragment fragment = new ArtistInfoMusicFragment();
  Bundle bundle = new Bundle();
  bundle.putParcelableArrayList("list", mList);
  fragment.setArguments(bundle);
  return fragment;
}

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

static PermissionListFragment newInstance(ArrayList<PermissionInfo> perms) {
 PermissionListFragment frag=new PermissionListFragment();
 Bundle args=new Bundle();
 args.putParcelableArrayList(ARG_PERMS, perms);
 frag.setArguments(args);
 return(frag);
}

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

void onSaveInstanceState(Bundle state) {
 for (int i=0;i<getItemCount();i++) {
  updateProse(i);
 }
 state.putParcelableArrayList(STATE_BUFFERS, buffers);
}

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

@Override
protected void onResult(int resultCode) {
  Bundle arguments = getArguments();
  ArrayList<Label> selected = new ArrayList<>();
  ArrayList<Label> choices = getChoices();
  if (selectedChoices != null) {
    for (int i = 0; i < selectedChoices.length; i++) {
      if (selectedChoices[i]) {
        selected.add(choices.get(i));
      }
    }
  }
  arguments.putParcelableArrayList(ARG_SELECTED, selected);
  super.onResult(resultCode);
  dismiss();
}

相关文章

Bundle类方法