Android: How to make launcher always open the main activity instead of child activity? (or otherwise)

前端 未结 2 1232
囚心锁ツ
囚心锁ツ 2021-02-06 00:39

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 usin

2条回答
  •  佛祖请我去吃肉
    2021-02-06 00:53

    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))

提交回复
热议问题