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

This code example shows how to use the following methods:clear
    } 
 
    public void setStatus(int status, Bundle extras, long updateTime) {
        mStatus = status;
        mStatusUpdateTime = updateTime;
        mExtras.clear();
        if (extras != null) {
            mExtras.putAll(extras);
        } 
        mHasStatus = true;
    } 
 
    public void clearStatus() { 
        mHasStatus = false;
        mStatusUpdateTime = 0;
    } 
 
    @Override 
    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        dump(pw, "");
7
CodeRank
This code example shows how to use the following methods:clear, putFloat, size
    assertTrue(bundle.containsKey("foo2"));
  } 
 
  @Test 
  public void testClear() { 
    bundle.putFloat("foo", 5f);
 
    bundle.clear();
 
    assertEquals(0, bundle.size());
  } 
 
  @Test 
  public void testIsEmpty() { 
    assertTrue(bundle.isEmpty());
    bundle.putBoolean("foo", true);
    assertFalse(bundle.isEmpty());
  } 
 
  @Test 
8
CodeRank
This code example shows how to use the following methods:clear, putFloat, size
        assertTrue(bundle.containsKey("foo2"));
    } 
 
    @Test 
    public void testClear() { 
        bundle.putFloat("foo", 5f);
 
        bundle.clear();
 
        assertEquals(0, bundle.size());
    } 
 
    @Test 
    public void testIsEmpty() { 
        assertTrue(bundle.isEmpty());
        bundle.putBoolean("foo", true);
        assertFalse(bundle.isEmpty());
    } 
 
    @Test 
8
CodeRank
This code example shows how to use the following methods:clear, containsKey
         * Note: This is a hack to work around a private serializable classloader attack 
         */ 
        try 
        { 
            // if a private serializable exists, this will throw an exception 
            bundle.containsKey(null);
        } 
        catch (final Exception e)
        { 
            bundle.clear();
            return true; 
        } 
 
        return false; 
    } 
} 
6
CodeRank
This code example shows how to use the following methods:clear, putAll
        return mEnabled;
    } 
 
    public int getStatus(Bundle extras) {
        if (mHasStatus) {
            extras.clear();
            extras.putAll(mExtras);
            return mStatus;
        } else { 
            return LocationProvider.AVAILABLE;
        } 
    } 
 
    public long getStatusUpdateTime() { 
        return mStatusUpdateTime;
    } 
 
    public int getAccuracy() { 
        return mAccuracy;
    } 
6
CodeRank
This code example shows how to use the following methods:clear, putAll
        mEnabled = true;
    } 
 
    public int getStatus(Bundle extras) {
        if (mHasStatus) {
            extras.clear();
            extras.putAll(mExtras);
            return mStatus;
        } else { 
            return LocationProvider.AVAILABLE;
        } 
    } 
 
    public long getStatusUpdateTime() { 
        return mStatusUpdateTime;
    } 
 
    public boolean isEnabled() { 
        return mEnabled;
    } 
6
CodeRank

Related Bundle clear Questions & Answers:

clear Method Overview
Removes all elements from the mapping of this Bundle.
See Code Examples for other Android Bundle Methods: