Bundle putStringArrayList - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Bundle putStringArrayList method.

This code example shows how to use the following methods:putInt, putString, putStringArrayList
 
 
	public static FolderItemListFragment newInstance(ArrayList<String> feedIds, String folderName, int currentState) {
		FolderItemListFragment feedItemFragment = new FolderItemListFragment();
 
		Bundle args = new Bundle();
		args.putInt("currentState", currentState);
		args.putStringArrayList("feedIds", feedIds);
		args.putString("folderName", folderName);
		feedItemFragment.setArguments(args);
 
		return feedItemFragment;
	} 
 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		currentState = getArguments().getInt("currentState");
		folderName = getArguments().getString("folderName");
		ArrayList<String> feedIdArrayList = getArguments().getStringArrayList("feedIds");
9
CodeRank
This code example shows how to use the following methods:getStringArrayList, putStringArrayList
  @Test 
  public void testStringArrayList() { 
    ArrayList<String> list = new ArrayList<String>();
    list.add("a");
 
    bundle.putStringArrayList("foo", new ArrayList<String>(list));
    Assert.assertEquals(list, bundle.getStringArrayList("foo"));
    assertNull(bundle.getStringArrayList("bar"));
  } 
 
  @Test 
  public void testIntegerArrayList() { 
    ArrayList<Integer> list = new ArrayList<Integer>();
    list.add(100);
 
    bundle.putIntegerArrayList("foo", new ArrayList<Integer>(list));
    Assert.assertEquals(list, bundle.getIntegerArrayList("foo"));
    assertNull(bundle.getIntegerArrayList("bar"));
  } 
 
8
CodeRank
This code example shows how to use the following methods:putStringArrayList
 
  @Override 
  protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
     
    outState.putStringArrayList(KEY_MIDDLE_CONTENTS, middleContents);
  } 
   
  @Override 
  protected void onRestoreInstanceState(Bundle inState) {
    middleContents=inState.getStringArrayList(KEY_MIDDLE_CONTENTS);
  } 
 
  void onListItemClick(SimpleListFragment fragment, int position) {
    if (fragment == middleFragment) {
      ((Button)root.getRightView()).setText(middleContents.get(position));
       
      if (isLeftShowing) {
        root.hideLeft();
        isLeftShowing=false;
6
CodeRank
This code example shows how to use the following methods:getStringArrayList, putStringArrayList
    @Test 
    public void testStringArrayList() { 
        ArrayList<String> list = new ArrayList<String>();
        list.add("a");
 
        bundle.putStringArrayList("foo", new ArrayList<String>(list));
        Assert.assertEquals(list, bundle.getStringArrayList("foo"));
        assertNull(bundle.getStringArrayList("bar"));
    } 
 
    @Test 
    public void testIntegerArrayList() { 
        ArrayList<Integer> list = new ArrayList<Integer>();
        list.add(100);
 
        bundle.putIntegerArrayList("foo", new ArrayList<Integer>(list));
        Assert.assertEquals(list, bundle.getIntegerArrayList("foo"));
        assertNull(bundle.getIntegerArrayList("bar"));
    } 
 
8
CodeRank
This code example shows how to use the following methods:putStringArrayList
    return(newInstance(new ArrayList<String>(Arrays.asList(contents))));
  } 
 
  public static SimpleListFragment newInstance(ArrayList<String> contents) {
    SimpleListFragment result=new SimpleListFragment();
    Bundle args=new Bundle();
 
    args.putStringArrayList(KEY_CONTENTS, contents);
    result.setArguments(args);
 
    return(result);
  } 
 
  @Override 
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
 
    getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    setContents(getArguments().getStringArrayList(KEY_CONTENTS));
  } 
7
CodeRank
This code example shows how to use the following methods:putStringArrayList
    extras.putByteArray(key, value);
  } 
 
  @Implementation 
  public Intent putStringArrayListExtra(String key, ArrayList<String> value) {
    extras.putStringArrayList(key, value);
    return realIntent;
  } 
 
  @Implementation 
  public ArrayList<String> getStringArrayListExtra(String name) {
    return extras.getStringArrayList(name);
  } 
 
  @Implementation 
  public Intent putIntegerArrayListExtra(String key, ArrayList<Integer> value) {
    extras.putIntegerArrayList(key, value);
    return realIntent;
  } 
 
6
CodeRank
This code example shows how to use the following methods:putInt, putStringArrayList
        super.onConfigurationChanged(newConfig);
    } 
 
    @Override 
    protected void onSaveInstanceState(Bundle outState) {
        outState.putStringArrayList("testsList", mTestsList);
        outState.putInt("totalCount", mTotalTestCount);
 
        super.onSaveInstanceState(outState);
    } 
 
    @Override 
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
 
        mTestsList = savedInstanceState.getStringArrayList("testsList");
        mTotalTestCount = savedInstanceState.getInt("totalCount");
    } 
 
    /** 
7
CodeRank
This code example shows how to use the following methods:putStringArrayList
        extras.putByteArray(key, value);
    } 
 
    @Implementation 
    public Intent putStringArrayListExtra(String key, ArrayList<String> value) {
        extras.putStringArrayList(key, value);
        return realIntent;
    } 
 
    @Implementation 
    public ArrayList<String> getStringArrayListExtra(String name) {
        return extras.getStringArrayList(name);
    } 
 
    @Implementation 
    public Intent putIntegerArrayListExtra(String key, ArrayList<Integer> value) {
        extras.putIntegerArrayList(key, value);
        return realIntent;
    } 
 
6
CodeRank
This code example shows how to use the following methods:putStringArrayList
   * 
   * @param key a String, or null 
   * @param value an ArrayList<String> object, or null 
   */ 
  public TaskResult addStringArrayList(String key, ArrayList<String> value) {
    mBundle.putStringArrayList(key, value);
    return this;
  } 
 
  /** 
   * Inserts an ArrayList<CharSequence> value 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<CharSequence> object, or null 
   */ 
  public TaskResult add(String key, ArrayList<CharSequence> value) {
    mBundle.putCharSequenceArrayList(key, value);
    return this;
  } 
5
CodeRank

Related Bundle putStringArrayList Questions & Answers:

putStringArrayList Method Overview
Inserts an ArrayList value into the mapping of this Bundle, replacing any existing value for the given key.
See Code Examples for other Android Bundle Methods: