Code example for Intent

Methods: getExtrasgetIntExtraputExtra

0
        assertSame(cs, intent.getExtras().get("foo"));
    } 
 
    @Test 
    public void testIntExtra() throws Exception { 
        Intent intent = new Intent();
        assertSame(intent, intent.putExtra("foo", 2));
        assertEquals(2, intent.getExtras().get("foo"));
        assertEquals(2, intent.getIntExtra("foo", -1));
    } 
 
    @Test 
    public void testDoubleExtra() throws Exception { 
        Intent intent = new Intent();
        assertSame(intent, intent.putExtra("foo", 2d));
        assertEquals(2d, intent.getExtras().get("foo"));
        assertEquals(2d, intent.getDoubleExtra("foo", -1));
    } 
 
    @Test 
    public void testFloatExtra() throws Exception {