ndroid.content.ActivityNotFoundException:

840 views Asked by At

android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myapp.videomodule/com.myapp.videomodule.VideoCallActivity}; have you declared this activity in your AndroidManifest.xml?

My app package is com.myapp.doctors module package is com.myapp.videomodule

if(splitInstallManager.getInstalledModules().contains("videomodule")){
Intent intent = new Intent(); 
intent.setClassName("com.myapp.videomodule", "com.myapp.videomodule.VideoCallActivity");
startActivity(intent); 
}

I have declared it in the manifest the thing is I am trying dymanic module delivery, so that videoactivity is in other module

3

There are 3 answers

1
Drusantia On

Try starting the intent like this:

Intent intent = new Intent(this, VideoCallActivity.class);
startActivity(intent)
1
Rodrigo João Bertotti On

Go to manifests > AndroidManifest.xml > check if com.myapp.videomodule.VideoCallActivity is declared there, if not, put it like:

<manifest>

.... 

<application
        ...>

        ...

        <activity
            android:name="com.myapp.videomodule.VideoCallActivity"
            android:label="@string/title_videocallactivity" your activity title 
            android:theme="@style/AppTheme.NoActionBar" />

        ...
</application>

</manifest>
0
Nico On

It seems that dynamic feature modules are declared in base app package. (as you can verify using Merged Manifest feature on your module Manifest.xml

I suggest the following modification:

if(splitInstallManager.getInstalledModules().contains("videomodule")){
    Intent intent = new Intent(); 
    intent.setClassName(getPackageName(), "com.myapp.videomodule.VideoCallActivity");
    startActivity(intent); 
}