I am getting this exception while I am trying to call an activity from another one. The complete exception is
android.content.ActivityNotFoundExcept
Looking at the documentation here what you want is:
intent.setClassName("com.x.y", "className");
Yeah I got this problem too. I refreshed the project. And then, everything works fine.
My solution to this error was to add a package name in front of the name in manifest.
I had the following activities:
id.scanner.main.A1
id.scanner.main.gallery.A2
My manifest contained the following:
<activity android:name=".A1" ....></activity>
<activity android:name=".A2" ....></activity>
This solved the problem:
<activity android:name=".A1" ....></activity>
<activity android:name="gallery.A2" ....></activity>
Hey, you need to use another form of Intent constructor. This will surely solve your issue within a second:
Example:
Intent inte=new Intent(getBaseContext(),"your class name with .class extension ");
startActivity(inte);
This works perfectly and I checked this code, its working properly.
This works if you have an Activity object (which you need to launch):
intent.setClassName(CallingActivity.this, activityToLaunch.getComponentName().getClassName());
Try using the following:
intent.setClassName("com.x.y", "com.x.y.className");
This works for me