You can't do this. The whole point of this check is that if you aren't running in the same process as the activity you are starting, well the other activity won't be running in your process so you can't get an Activity object for it or do much of anything with it.
If you want to test a particular activity, your instrumentation needs to be signed with the same certificate as the target activity's .apk and declare that it is instrumenting that .apk. 2009/4/3 [email protected] <[email protected]> > > Following is the code for equal checking: > > In Instrumentation.java, startActivitySync function, > > public Activity startActivitySync(Intent intent) { > > … > > if (!ai.applicationInfo.processName.equals( > > getTargetContext().getPackageName())) { > > // todo: if this intent is ambiguous, look here to see if > > // there is a single match that is in our package. > > throw new RuntimeException("Intent resolved to different package " > > + ai.applicationInfo.packageName + ": > " > > + intent); > } > > } > > > > On 4月3日, 下午2時00分, "[email protected]" <[email protected]> wrote: > > Hi all, > > > > I'd like to do the instrumentation testing for DialtactaActivity, > > however, before running the instrumentation, it will check whether the > > process name and packages name are equal. > > > > Unfortunately, the process name and packages name of DialtactsActivity > > are different and result fail in running. > > > > Is there any way to make the process work? > > > > BRs > > Angela > > > -- 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-framework" 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-framework?hl=en -~----------~----~----~----~------~----~------~--~---
