0

I have a form that I open in a webview in my app, after I complete it, it will appear a button that will let me download a pdf andd open it but when I do this I keep getting the next error:

OneSignal: FusedLocationApi.requestLocationUpdates failed!
    java.lang.NullPointerException: Calling thread must be a prepared Looper thread.
        at com.google.android.gms.common.internal.Preconditions.checkNotNull(com.google.android.gms:play-services-basement@@17.6.0:2)
        at com.google.android.gms.internal.location.zzz.requestLocationUpdates(com.google.android.gms:play-services-location@@18.0.0:4)
        at com.onesignal.GMSLocationController$FusedLocationApiWrapper.requestLocationUpdates(GMSLocationController.java:198)
        at com.onesignal.GMSLocationController$LocationUpdateListener.init(GMSLocationController.java:181)
        at com.onesignal.GMSLocationController$LocationUpdateListener.<init>(GMSLocationController.java:165)
        at com.onesignal.GMSLocationController.onFocusChange(GMSLocationController.java:117)
        at com.onesignal.LocationController.onFocusChange(LocationController.java:326)
        at com.onesignal.OneSignal.onAppLostFocus(OneSignal.java:1308)
        at com.onesignal.ActivityLifecycleHandler$AppFocusRunnable.run(ActivityLifecycleHandler.java:279)
        at java.lang.Thread.run(Thread.java:923)

The button will appear in the webview. I think I get that error because I open the pdf on the main thread.

Mario Muresean
  • 233
  • 1
  • 5
  • 16
  • Does this answer your question? [Android: "Calling thread must be a prepared Looper thread" error when I use AsyncTask](https://stackoverflow.com/questions/42483113/android-calling-thread-must-be-a-prepared-looper-thread-error-when-i-use-asyn) – Nitish Nov 10 '21 at 11:56
  • 2
    can i ask you to add related code? – Shoaib Kakal Nov 10 '21 at 12:23

0 Answers0