Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebView Activity NullPointerException on loadUrl() #39

Open
dariush-fathie opened this issue Apr 5, 2020 · 0 comments
Open

WebView Activity NullPointerException on loadUrl() #39

dariush-fathie opened this issue Apr 5, 2020 · 0 comments

Comments

@dariush-fathie
Copy link

This is from Firebase Crashlytics:

Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void android.webkit.WebView.loadUrl(java.lang.String)' on a null object reference at saschpe.android.customtabs.WebViewActivity.onCreate() at android.app.Activity.performCreate(Activity.java:6876) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349) at android.app.ActivityThread.access$1100(ActivityThread.java:221) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7225) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

It's happened multiple times across different devices like and mostly Xiaomi(~33%).
70% of crashes occurred on Android 9.

And it's All written codes to interact with customTab:

val customTabsIntent: CustomTabsIntent? = CustomTabsIntent.Builder()
            .setToolbarColor(ContextCompat.getColor(context, R.color.colorPrimary))
            .setShowTitle(true)
            .build()

        CustomTabsHelper.addKeepAliveExtra(context, customTabsIntent!!.intent)

        CustomTabsHelper.openCustomTab(
            context, customTabsIntent,
            Uri.parse(uri),
            WebViewFallback()
        )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant