title: ActivityNotFoundException: Unable to find explicit activity class - in Jelly bean (4.2.2)
body: <p>I am getting this exception (ActivityNotFound) only on android 4.2.2, while starting an activity from a custom view.  This works fine on all devices which are 4.1.1 and below. </p>
  
  <p>Has anyone faced similar issues with 4.2.2 ?</p>
  
  <p>Code that starts the activity from my custom view </p>
  
  <pre><code>Intent intent = new Intent(getContext(), MyActivity.class);
  intent.putExtra(Constants.EXTRAS1, serializable);
  intent.putExtra(Constants.EXTRAS2, serializable);           
  ((Activity)getContext()).startActivityForResult(intent, Constants.MY_ACTION);
  </code></pre>
  
  <p>Stacktrace:</p>
  
  <pre><code>06-04 16:58:29.715: E/AndroidRuntime(20568): FATAL EXCEPTION: main
  06-04 16:58:29.715: E/AndroidRuntime(20568): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.sample.activity/com.sample.activity.MyActivity}; have you declared this activity in your AndroidManifest.xml?
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1635)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1434)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.app.Activity.startActivityForResult(Activity.java:3430)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.app.Activity.startActivityForResult(Activity.java:3391)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.View.dispatchTouchEvent(View.java:7461)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2270)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2010)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2270)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2010)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2270)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2010)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2270)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2010)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2270)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2010)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2270)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2010)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2270)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2010)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2270)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2010)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2270)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2010)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2186)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1516)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.app.Activity.dispatchTouchEvent(Activity.java:2466)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2134)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.View.dispatchPointerEvent(View.java:7641)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3676)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3607)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4802)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4781)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4873)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.os.MessageQueue.nativePollOnce(Native Method)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.os.MessageQueue.next(MessageQueue.java:125)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.os.Looper.loop(Looper.java:124)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at android.app.ActivityThread.main(ActivityThread.java:5293)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at java.lang.reflect.Method.invokeNative(Native Method)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at java.lang.reflect.Method.invoke(Method.java:511)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
  06-04 16:58:29.715: E/AndroidRuntime(20568):    at dalvik.system.NativeStart.main(Native Method)
  </code></pre>