androidandroid-intentandroid-activityexplicit-intent

Unable to find explicit activity class, even when i declare the intent in the manifest


I have an activity which I declare in my manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.my">
  <uses-sdk android:minSdkVersion="14"/>
  <application>
    <activity
        android:name="com.my.InternalDummyActivity"
        android:exported="false">
    </activity>
  </application>
</manifest>

I have tried without the exported=false as well

The application contains an inner library with another activity.

I try to call an explicit intent from the other activity (other namespace) But I always get an exception:

Intent intent1 = new Intent(activity.getApplicationContext(), InternalDummyActivity.class);
activity.startActivity(intent1);


ComponentName componentName2 =
    new ComponentName(
        "com.my","com.my.InternalDummyActivity");
Intent intent2 = new Intent().setComponent(componentName2); //dones work
activity.startActivity(intent2);


Process: com.comp.outter, PID: 9267
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.my/com.my.InternalDummyActivity}; have you declared this activity in your AndroidManifest.xml?

How can I fix this?


Solution

  • This question is possible duplicate of the thread gives below How to call activity from a library module in android studio

    Check if this is what you are looking for.