rubenlop88
rubenlop88

Reputation: 4221

Why the error "Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag" happens only on some devices?

I'm getting a crash report on Firebase with the message

Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag.

This error occurs on a Samsung GT-I9500 with Android 19. I can't reproduce the error o my Google Pixel with Android Oreo (27).

I know how to set the flag, but I'm curious to know why this error occurs only on some versions of Android.

Here's how I'm starting the Activity:

    context.getApplicationContext().startActivity(intent);

Upvotes: 4

Views: 2562

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006849

I'm curious to know why this error occurs only on some versions of Android.

Because of a bug. See this issue and this issue.

Upvotes: 3

Related Questions