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

Intents Flags no working on API 8

    // Start our SignInActivity
   Intent intent = new Intent(this, SignInActivity.class);
   intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
   intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
   startActivity(intent);

The code above does not work when in API level 10 and below. Help please. Ben Jakuben

1 Answer

Juan P. Prado
Juan P. Prado
70,727 Points

If you want backwards compatible of FLAG_ACTIVITY_CLEAR_TASK you can use IntentCompat http://developer.android.com/reference/android/support/v4/content/IntentCompat.html