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

This code example shows how to use the following methods:putInt, size
    assertEquals(7, bundle.getInt("bar", 7));
  } 
 
  @Test 
  public void testSize() { 
    assertEquals(0, bundle.size());
    bundle.putInt("foo", 5);
    assertEquals(1, bundle.size());
    bundle.putInt("bar", 5);
    assertEquals(2, bundle.size());
  } 
 
  @Test 
  public void testLong() { 
    bundle.putLong("foo", 5);
    assertEquals(5, bundle.getLong("foo"));
    assertEquals(0,bundle.getLong("bar"));
    assertEquals(7, bundle.getLong("bar", 7));
  } 
 
8
CodeRank
This code example shows how to use the following methods:putInt, size
        assertEquals(7, bundle.getInt("bar", 7));
    } 
 
    @Test 
    public void testSize() { 
        assertEquals(0, bundle.size());
        bundle.putInt("foo", 5);
        assertEquals(1, bundle.size());
        bundle.putInt("bar", 5);
        assertEquals(2, bundle.size());
    } 
 
    @Test 
    public void testLong() { 
        bundle.putLong("foo", 5);
        assertEquals(5, bundle.getLong("foo"));
        assertEquals(0,bundle.getLong("bar"));
        assertEquals(7, bundle.getLong("bar", 7));
    } 
 
8
CodeRank

Related Bundle size Questions & Answers:

size Method Overview
Returns the number of mappings contained in this Bundle.
See Code Examples for other Android Bundle Methods: