Code example for Intent

Methods: getDatagetTypesetDataAndType

0
        assertEquals("def", intent.getType());
    } 
 
    @Test 
    public void testSetDataAndType() throws Exception { 
        Intent intent = new Intent();
        Uri uri = Uri.parse("content://this/and/that");
        assertSame(intent, intent.setDataAndType(uri, "ghi"));
        assertSame(uri, intent.getData());
        assertEquals("ghi", intent.getType());
    } 
 
    @Test 
    public void testSetClass() throws Exception { 
        Intent intent = new Intent();
        Class<? extends IntentTest> thisClass = getClass();
        Intent output = intent.setClass(new Activity(), thisClass);
 
        assertSame(output, intent);
        ShadowIntent si = shadowOf(intent);
        assertSame(si.getIntentClass(), thisClass);