07-20-2023, 03:49 PM
It is possible to start an app's activity by using [`Intent.setClassName`][1] according to the docs.
An example:
```kotlin
val activityName = "com.google.android.apps.muzei.MuzeiActivity" // target activity name
val packageName = "net.nurik.roman.muzei" // target package's name
val intent = Intent().setClassName(packageName, activityName)
startActivity(intent)
```
To open it outside the current app, add this flag before starting the intent.
```kotlin
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
```
A related answer [here](
[1]:
An example:
```kotlin
val activityName = "com.google.android.apps.muzei.MuzeiActivity" // target activity name
val packageName = "net.nurik.roman.muzei" // target package's name
val intent = Intent().setClassName(packageName, activityName)
startActivity(intent)
```
To open it outside the current app, add this flag before starting the intent.
```kotlin
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
```
A related answer [here](
[To see links please register here]
)[1]:
[To see links please register here]