Bundle getStringArrayList - 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 getStringArrayList method.

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: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:getStringArrayList
    } 
 
    @Override 
    public void onResults(Bundle results) {
    	processingPd.dismiss();
        ArrayList<String> strings = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
        if (mListener != null)
        	mListener.onSpeechResult(strings.size() == 0 ? "" : strings.get(0));
    } 
 
    @Override 
    public void onRmsChanged(float arg0) {
    } 
 
} 
6
CodeRank
This code example shows how to use the following methods:getStringArrayList
    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;
      } 
    } 
    else { 
      middleContents=new ArrayList<String>();
 
6
CodeRank
This code example shows how to use the following methods:containsKey, getStringArrayList
savedInstanceState.putStringArrayList("history", history);
    } 
     
    public void onRestoreInstanceState(Bundle savedInstanceState) {
    	if (savedInstanceState.containsKey("history")) {
			ArrayList<String> history = new ArrayList<String>();
			history = savedInstanceState.getStringArrayList("history");
			initAdapter(history);
		} 
    } 
     
    @Override 
    public boolean performClick() { 
    	if (adapter.getCount() > 0) showDropDown();
    	return super.performClick(); 
    } 
     
    public String getHistoryString() {
    	StringBuilder string = new StringBuilder();
7
CodeRank
This code example shows how to use the following methods:getStringArrayList
    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;
  } 
 
  @Implementation 
  public ArrayList<Integer> getIntegerArrayListExtra(String name) {
    return extras.getIntegerArrayList(name);
  } 
 
  @Implementation 
6
CodeRank
This code example shows how to use the following methods:getInt, getStringArrayList
 
    @Override 
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
 
        mTestsList = savedInstanceState.getStringArrayList("testsList");
        mTotalTestCount = savedInstanceState.getInt("totalCount");
    } 
 
    /** 
     * (Re)starts the executer activity from the given test number (inclusive, 0-based). 
     * This number is an index in mTestsList, not the sublist passed in the intent. 
     * 
     * @param startFrom 
     *      test index in mTestsList to start the tests from (inclusive, 0-based) 
     */ 
    private void restartExecutor(int startFrom) {
        Intent intent = new Intent();
        intent.setClass(this, LayoutTestsExecutor.class);
        intent.setAction(Intent.ACTION_RUN);
6
CodeRank
This code example shows how to use the following methods:containsKey, getStringArrayList
     
    public static List<String> getHeardFromDirect(Bundle bundle)
    { 
        List<String> results = new ArrayList<String>();
        if ((bundle != null)
                && bundle.containsKey(SpeechRecognizer.RESULTS_RECOGNITION))
        { 
            results =
                bundle.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
        } 
        return results;
    } 
 
    public static float[] getConfidenceFromDirect(Bundle bundle)
    { 
        float [] scores = null;
        if ((bundle != null)
                && bundle.containsKey(SpeechRecognizer.RESULTS_RECOGNITION))
        { 
            scores =

7
CodeRank
This code example shows how to use the following methods:getStringArrayList
        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;
    } 
 
    @Implementation 
    public ArrayList<Integer> getIntegerArrayListExtra(String name) {
        return extras.getIntegerArrayList(name);
    } 
 
    @Implementation 
6
CodeRank
This code example shows how to use the following methods:getStringArrayList
            if (extra.containsKey(RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES)) { 
                mHandler.post(new Runnable() { 
 
                    @Override 
                    public void run() { 
                        updateSupportedLanguages(extra.getStringArrayList( 
                                RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES)); 
                    } 
                }); 
            } 
 
            if (extra.containsKey(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE)) { 
                mHandler.post(new Runnable() {
 
                    @Override 
                    public void run() { 
                        updateLanguagePreference( 
                                extra.getString(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE));
                    } 
                }); 
5
CodeRank

Related Bundle getStringArrayList Questions & Answers:

getStringArrayList Method Overview
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.
See Code Examples for other Android Bundle Methods: