Code example for Intent

Methods: getExtrasputExtra, getDoubleExtra

0
        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 { 
        Intent intent = new Intent();
        assertSame(intent, intent.putExtra("foo", 2f));
        assertEquals(2f, intent.getExtras().get("foo"));
        assertEquals(2f, intent.getFloatExtra("foo", -1));
    } 
 
    @Test 
    public void testIntArrayExtra() throws Exception {