1 | initial version |
To switch between two of your own Android apps using implicit intent, follow these steps:
<intent-filter>
<action android:name="com.example.myapp.ACTION_SWITCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
val intent = Intent("com.example.myapp.ACTION_SWITCH")
intent.setPackage("com.example.otherapp")
startActivity(intent)
Ensure that the receiving app is installed on the device, and that the package name in the Intent object matches the receiving app's package name.
Run both apps and invoke the Intent from the sending app to launch the receiving activity.