The line: ResolveInfo ri = manager.resolveActivity(exceptionIntent,0);
should read: ResolveInfo ri = manager.resolveActivity(myIntent,0); On Jul 10, 3:28 pm, CMWiii <[email protected]> wrote: > In a test app I pass an intent to resolveActivity to find out what is > the > best fit for the intent. > > For example: > > Intent myIntent = new Intent(); > > myIntent.setPackage(PackageName); > myIntent.addCategory(Intent.CATEGORY_LAUNCHER); > myIntent.setAction(Intent.ACTION_MAIN); > > PackageManager manager = getPackageManager(); > > ResolveInfo ri = manager.resolveActivity(exceptionIntent,0); > > if (ri != null) { > Intent newIntent = new Intent(); > > newIntent.setClassName(PackageName, > ri.activityInfo.applicationInfo.className); > newIntent.setFlags(ri.activityInfo.flags); > > startActivity(newIntent); > } > > The result of all this is an error: > "android.content.ActivityNotFoundException: Unable to find explicit > activity > class ......." > > Any suggestions or thoughts on why I am getting back an activity that > then can't be > found by startActivity? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

