ActivityInfo is null in Intrumentation class

Put your problem here if it does not fit any of the other categories.

ActivityInfo is null in Intrumentation class

Postby andy@lg » Tue Apr 28, 2009 12:03 pm

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. @Override
  2.     public void onStart() {
  3.         super.onStart();    
  4. _intent = new Intent(Intent.ACTION_MAIN);
  5. _intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  6. _intent = _intent.setClass(getTargetContext(), ClassUnderTest.class);
  7. ActivityInfo ai = _intent.resolveActivityInfo(getTargetContext().getPackageManager(), 0);
  8.         if (ai != null) {
  9.                    ClassUnderTest activity = (ClassUnderTest)startActivitySync(_intent);
  10.         }      
  11. }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


This a part of my code in my Instrumentation class. Earlier, i got a run time Exception,
java.lang.RuntimeException: Unable to resolve activity for: Intent { flags=0x10000000 comp={com.android.test.ui/com.android.test.ui.ClassUnderTest} }
. Later on, i checked the activity info which is always null. How to set the ActivityInfo..? What is required to update in the code?

Thanks,
Android Developer
andy@lg
Freshman
Freshman
 
Posts: 8
Joined: Thu Feb 26, 2009 8:52 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 20 guests