Попробуйте этот код в Kotlin :
fun runDifferentActivity() {
// Different app package
val otherAppPackage = "comp.package.android.something.there"
// Activity name (from different App)
val otherAppActivity = "SecretActivity"
val action = "$otherAppPackage.$otherAppActivity"
// Create Intent with action name
val intent = Intent(action)
// Start activity
startActivity(intent)
}
или в Java:
void runDifferentActivity() {
// Different app package
String otherAppPackage = "comp.package.android.something.there";
// Activity name (from different App)
String otherAppActivity = "SecretActivity";
String action = String.format("%s.%s", otherAppPackage, otherAppActivity);
// Create Intent with action name
Intent intent = new Intent(action);
// Start activity
startActivity(intent);
}