Alternative to Intent.FLAG_ACTIVITY_CLEAR_TASK

后端 未结 6 1079
傲寒
傲寒 2021-02-06 22:59

I have two apps App-B launches App-A. If the user starts App B from inside App A I call finish on App-A so I have no problem.

If the user goes straight to App B from th

6条回答
  •  感情败类
    2021-02-06 23:04

    The new IntentCompat should've helped on that, but apparently the flag is ignored for API lower than 11.

    To use IntentCompat do following:

    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
    IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);
    

提交回复
热议问题