Posts

Showing posts with the label android-manifest

Switch TargetActivity programatically

Switch TargetActivity programatically I have an activity alias that leads to one of my activities. <activity-alias android:name="LauncherOne" android:enabled="true" android:targetActivity="org.test.app.LauncherActivity"> <intent-filter> <action android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity-alias> I want to be able to choose which activity it goes to, so how can I change the targetActivity programatically? I can't really find a workaround, because I cant enable/disable two different targetactivities as it would forget the default launcher every time. And I haven't found a way to switch acitivities that doesn't cost some performance in my app. 1 Answer 1 ...