06 November 2014

Start Intent dari ResolveInfo

Get ResolveInfo dari queryBroadcastReceivers()


Given a ResolveInfo named launchable:
ActivityInfo activity=launchable.activityInfo;
ComponentName name=new ComponentName(activity.applicationInfo.packageName,
                                     activity.name);
Intent i=new Intent(Intent.ACTION_MAIN);

i.addCategory(Intent.CATEGORY_LAUNCHER);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
            Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
i.setComponent(name);

startActivity(i);

ref: http://stackoverflow.com/questions/12504954/how-to-start-an-intent-from-a-resolveinfo



No comments:

Post a Comment

Terima kasih