I have need to show autorizationa activity if user not autorized.
I have use Launcher activity (has nohistory flag) with next code:
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
if (Autorization.isAutorized())
{
Intent newIntent = new Intent(this, MainActivity.class);
// add some flags????
startActivity(newIntent);
}
else startActivity(new Intent(this, AutorizationActivity.class));
}
When autorization
are complete, AutorizationActivity
starts Launcher with FLAG_ACTIVITY_CLEAR_TOP
and then Launcher
starts MainActivity
, but I have some trubles with backstack. By pressing back in MainActivity
android shows AutorizationActivity
again instead to hide task.
What flags I must use to prevent go back to AutorizationActivity
from MainActivity
?