What is "Name"? ComponentName has a constructor that takes a package name and class name; in the activity info these are .packageName and .name.
On Sat, Jul 10, 2010 at 3:52 PM, CMWiii <[email protected]> wrote: > Same result: > > used: > myIntent.setComponent(ComponentName.unflattenFromString(Name)); > > > On Jul 10, 3:38 pm, Mark Murphy <[email protected]> wrote: > > Try setComponent() instead of setPackage(). > > > > > > > > On Sat, Jul 10, 2010 at 6: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]<android-developers%[email protected]> > > > For more options, visit this group at > > >http://groups.google.com/group/android-developers?hl=en > > > > -- > > Mark Murphy (a Commons Guy)http://commonsware.com| > http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > > > _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.6 > > Available! > > -- > 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]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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

