Saturday, 15 February 2014

Android Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK not working -


I am developing small Android apps in which I have 3 activities back from A1, A1, A2, A3 and A2 But when I start A3 and the user presses the button back then I want to close all the previous windows. I tried to do this in the following ways:

  intended intent = new intent (login.Wish this, dashboard activity class); Intent.addFlags (Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent. FLAG_ACTIVITY_NEW_TASK); Intent.addFlags (Intent.FLAG_ACTIVITY_NO_HISTORY); StartActivity;  

But this is not working for me, I am using action-time activity. I tried to clear the job:

  intent.setFlags (Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);  

Work for me on the clearing work, but it starts my A3 with some blank white screen.

try it

  intent = intent (new login). This, dashboard activity category); Intent.setFlags (Intent.FLAG_ACTIVITY_NEW_TASK | Int'.fLAG_ACTIVITY_CLEAR_TASK); StartActivity;  

No comments:

Post a Comment