关于App:
1 -
objeditor.putString(AppConstants.USER_ID,"");
objeditor.commit();
Intent i=new Intent(MoreActivity.this, Login.class);//use ApplicationContext() as well
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
finish();
2 -
Intent i=new Intent(MoreActivity.this, Login.class);
for(int index=0;index<AppConstants.objactivity.size();index++)
{
if(AppConstants.objactivity!=null && AppConstants.objactivity.get(index)!=null)
{
AppConstants.objactivity.get(index).finish();
}
}
AppConstants.objactivity.clear();
startActivity(i);
请有人建议我提前谢谢
答案 0 :(得分:0)
试试这个:
startActivity(new Intent(MoreActivity.this, LoginActivity.class)
.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
| Intent.FLAG_ACTIVITY_NO_HISTORY
| Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_CLEAR_TASK ));
finish();