Skip to content

AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK ... #11820

Closed

Description

@oguzkocer

It looks like this started happening in 14.6-rc-1 and has a fairly large number of crashes for a new release.

Sentry Url: https://sentry.io/share/issue/d2c5279461844602a86a9d5441fa2f3b/
User Count: 701
Count: 1885
First Release: org.wordpress.android-14.6-rc-1
First Seen: 2020-04-06T19:21:55Z
Last Seen: 2020-05-05T14:08:55Z
24 Hours: 213
30 Days: 1874

AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
     at android.app.ContextImpl.startActivity(ContextImpl.java:1609)
     at android.app.ContextImpl.startActivity(ContextImpl.java:1596)
     at android.content.ContextWrapper.startActivity(ContextWrapper.java:337)
     at org.wordpress.android.ui.ActivityLauncher.openUrlExternal(ActivityLauncher.java:893)
     at org.wordpress.android.ui.reader.ReaderActivityLauncher.openUrl(ReaderActivityLauncher.java:283)
     at org.wordpress.android.util.URLFilteredWebViewClient.shouldOverrideUrlLoading(URLFilteredWebViewClient.java:73)
     at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(PG:17)
     at android.os.MessageQueue.nativePollOnce(MessageQueue.java:null)
     at android.os.MessageQueue.next(MessageQueue.java:143)
     at android.os.Looper.loop(Looper.java:130)
...
(5 additional frame(s) were not displayed)

Activity

  1. self-assigned this
    on May 8, 2020
  2. ashiagr commented on May 8, 2020

    @ashiagr
    Contributor

    Tested on Lollipop emulator, it is 100% reproducible. Just added a link to be opened in an external browser in a post, previewed the post, clicked the link -> 💥.

    99% occurrence is on OS below Android 6.

    Also seems like FLAG_ACTIVITY_NEW_TASK requirement is now enforced: https://developer.android.com/about/versions/pie/android-9.0-changes-all#fant-required

  3. bummytime commented on May 8, 2020

    @bummytime
    Contributor

    💥 Thank you for looking at this @ashiagr !

  4. peril-wordpress-mobile commented on May 8, 2020

    @peril-wordpress-mobile
    Fails
    🚫 Please add a feature label to this issue. e.g. 'Stats'

    Generated by 🚫 dangerJS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions