Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Self-Destructing Message Android App Starting the App Navigation with Back and Up

aimensasi
aimensasi
11,343 Points

FLAG_ACTIVITY_CLEAR_TASK is not working?

There is no error showing, but when running the app it seems like it is not working. I am still able to go back from inbox to sign in page.

2 Answers

you need to rebuild your project when the squiggly lines still show on your project. those could be false positives...

Hi there,

Can you post your code please - we might be able to see what the problem is.

Thanks,

Steve.

aimensasi
aimensasi
11,343 Points

This the intent code from the main activity:

Intent intent = new Intent(this, LogInActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(intent);

Did you clean your project it worked for me.