activity android:launchMode="singleTask" 没用重现启动activity的问题

本意是想设置activity的单例,不知道是google的问题,还是怎么回事,并不能重新创建,不过可以通过

@Override

protected void onNewIntent(Intent intent) {

super.onNewIntent(intent);

setIntent(intent);

}

以上代码会清空intent中的历史数据,以保证数据的干净。

原文地址:https://www.cnblogs.com/lilihuang/p/2048092.html