Skip to content Skip to sidebar Skip to footer

Android: How To Make Launcher Always Open The Main Activity Instead Of Child Activity? (or Otherwise)

I have activities A and B. The A is the one with LAUNCHER intent-filter (i.e. the activity that is started when we click the app icon on home screen). A launches B using startActi

Solution 1:

Well you should really have activity B initialize your resources too. But you can put android:clearTaskOnLaunch="true" in your manifest for activity A to have the launcher always go to that activity.

Solution 2:

Have you tried setting Flag FLAG_ACTIVITY_NEW_TASK while creating intent. In your case please try startActivity(new Intent(A.this, B.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK))

Post a Comment for "Android: How To Make Launcher Always Open The Main Activity Instead Of Child Activity? (or Otherwise)"