Code example for Intent

Methods: hasExtra

0
        assertEquals(-1L, intent.getLongExtra("bar", -1));
    } 
 
    @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();