Hello everyone, I have a problem doing a startActi...
# android
j
Hello everyone, I have a problem doing a startActivity to an Activity that is in another module of the application. I have this error. Maybe it has happened to someone else and they can help me
android.content.ActivityNotFoundException: Unable to find explicit activity class {package/packgae.OtherActivityInFeatureModule}; have you declared this activity in your AndroidManifest.xml?
I was seeing that it is added in the manifest-merge but I still have the error I am creating the intent like this
Copy code
fun intentToClear(intentActivity: IntentActivity, bundle: Bundle? = null): Intent {
    val intent = Intent(Intent.ACTION_VIEW).setClassName(PACKAGE_NAME, intentActivity.className)
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
    bundle?.let {
        intent.putExtras(it)
    }
    return intent
}
😶 3
e
HI! Do you trying to log
intentActivity.className
maybe something is weird here. But the more common solution is that your
Activity
is inside a custom package so you have to add in the
manifest
the custom package before the name of activity
j
Hi Erick! intentActivity is equivalent to something like
ModulePackage.ui.ModuleActivity
in android manifest module declared activity with this
Copy code
<activity
            android:name=".ui.ModuleActivity"
            android:launchMode="singleTop"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustResize"
            android:theme="@style/Theme.Hapi.NoActionBar" />
102 Views