I have used alarm manager to launch stage2 at specific time and whenever app will receive broadcast from alarm manager it will launch appropriate activity. When app is running in stage1 and broadcast received I have used following coed to launch appropriate activity
Intent i = new Intent(context, StageTwo.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
this code launches activity fine but when back key is pressed previous stage1 activity resumes I want to exit from app on pressing back button as user is not allowed to go back when activity is launched
pleas help as I am stuck at this point and can't find solution