基本上我希望用户能够在某个时刻回击并触及我的主要活动。所以这里有两个指标:
这可能吗?我认为对于Senario 2,代码看起来是这样的:
Intent mainActivityIntent = new Intent(context, MainActivity.class);
mainActivityIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); //this basically starts the app from fresh (i.e. clears current activities)
Intent addCruisesIntent = new Intent(context, SecondActivity.class);
addCruisesIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK ); //this basically starts the app from fresh (i.e. clears current activities)
Intent[] intents={mainActivityIntent,addCruisesIntent};
Intent[] intents={addCruisesIntent};
PendingIntent pendingIntent = PendingIntent.getActivities(context, 0, intents, 0);
我想知道是否有旗帜或旗帜组合可以达到我想要的效果。