Code example for ComponentName

Methods: setComponent

0
        intentB.setAction("action");
        intentB.setData(Uri.parse("content:other"));
        assertThat(intentA).isNotEqualTo(intentB);
 
        intentB.setData(Uri.parse("content:1"));
        intentB.setComponent(new ComponentName("other-pkg", "other-cls"));
        assertThat(intentA).isNotEqualTo(intentB);
 
        intentB.setComponent(new ComponentName("pkg", "cls"));
        intentB.putExtra("extra", "foo");
        assertThat(intentA).isNotEqualTo(intentB);
 
        intentB.putExtra("extra", "blah");
        intentB.setType("other/*");
        assertThat(intentA).isNotEqualTo(intentB);
 
        intentB.setType("image/*");
        assertThat(intentA).isEqualTo(intentB);
 
        intentB.removeCategory("category.name");
        assertThat(intentA).isNotEqualTo(intentB);