Code example for Intent

Methods: hasExtra

0
        assertEquals(5, intent.getBundleExtra("foo").getInt("bar"));
    } 
 
    @Test 
    public void testHasExtra() throws Exception { 
        Intent intent = new Intent();
        assertSame(intent, intent.putExtra("foo", ""));
        assertTrue(intent.hasExtra("foo"));
        assertFalse(intent.hasExtra("bar"));
    } 
 
    @Test 
    public void testGetActionReturnsWhatWasSet() throws Exception { 
        Intent intent = new Intent();
        assertSame(intent, intent.setAction("foo"));
        assertEquals("foo", intent.getAction());
    } 
 
    @Test 
    public void testSetData() throws Exception { 
        Intent intent = new Intent();