well, so, that´s my problem.
I need, when the user press the back bottom, to delete the stack of all activities opened:
@Override
public void onBackPressed(){
Intent i = new Intent(context, CrisolMainApp.class);
i.putExtra(CrisolMainApp.CERRAR_APP, true);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
}
The point is that this is working with most of my phones, but yesterday I tried with a Samsung Galaxy Mini (android 2.3.3) and it is not working!! It is not deleting the stack of activities.
Anyone knows why?
EDIT: I was checking on doc, and I found out that the "Intent.FLAG_ACTIVITY_CLEAR_TASK" was added on API 11(my Samsung Galaxy Mini is working for Android 2.3.3, so, API 10).......I don´t know, but I guess that´s the problem.
Anyone knows how can I make it work the same way for API less than 11?
I was trying by adding these flags and it is not working either:
@Override
public void onBackPressed(){
Intent a = new Intent(this, CrisolMainApp.class);
a.putExtra(CrisolMainApp.CERRAR_APP, true);
a.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);
a.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
a.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(a);
finish();
}
and I also tried:
@Override
public void onBackPressed(){
Intent a = new Intent(this, CrisolMainApp.class);
a.putExtra(CrisolMainApp.CERRAR_APP, true);
a.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
a.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(a);
finish();
}