Code example for ComponentName

Methods: getReceiverInfo

0
        assertNull("Meta data returned when not requested", ai.metaData);
    } 
 
    @SmallTest 
    public void testReceiverWithData() throws Exception { 
        ComponentName cn = new ComponentName(mContext, LocalReceiver.class);
        ActivityInfo ai = mContext.getPackageManager().getReceiverInfo(
                cn, PackageManager.GET_META_DATA);
 
        checkMetaData(cn, ai);
 
        ai = mContext.getPackageManager().getReceiverInfo(cn, 0);
 
        assertNull("Meta data returned when not requested", ai.metaData);
    } 
 
    @SmallTest 
    public void testServiceWithData() throws Exception { 
        ComponentName cn = new ComponentName(mContext, LocalService.class);
        ServiceInfo si = mContext.getPackageManager().getServiceInfo(
                cn, PackageManager.GET_META_DATA);