views:

80

answers:

1

Is there a way run an intent from packageinfo? I've been searching and I don't find it.

I tried like that Intent i = new Intent(); i.setAction(Intent.ACTION_MAIN); i.addCategory(Intent.CATEGORY_LAUNCHER); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); i.setComponent(new ComponentName(p.applicationInfo.packageName,p.applicationInfo.name)); startActivity(i);

but it doesn't work because [p.applicationInfo.name] is always null.

A: 

Try use folowing code: Intent i = getPackageManager().p.applicationInfo.packageName(p.applicationInfo.packageName); startActivity(i);

before start activity you may setup any flags (i.setFlags()), if you need.

Demand