If you're searching for packageName
and className
for filling ordered broadcast, I really suggest to check content of ResolveInfo object you're probably using
- ResolveInfo contains ActivityInfo object
- ActivityInfo contains ApplicationInfo object
- ApplicationInfo object contain what you need
so in you case, if you need to complete content of intent, I may suggest
ResolveInfo ri = ... // get where you need
Intent intent = new Intent();
intent.setComponent(new ComponentName(
ri.activityInfo.applicationInfo.packageName,
ri.activityInfo.applicationInfo.className));
this should work for you case
Edit: in cases, you obtained ResolveInfo for specific intent, className
should be null
. In these cases I successfully use ri.activityInfo.name
which returns correct className
because activityInfo
is for one specific activity