java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()

GitHub | muhammad-naderi | 8 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.

Root Cause Analysis

  1. java.lang.RuntimeException

    Can't create handler inside thread that has not called Looper.prepare()

    at android.os.Handler.<init>()
  2. Android Platform
    Handler.<init>
    1. android.os.Handler.<init>(Handler.java:200)
    2. android.os.Handler.<init>(Handler.java:114)
    2 frames
  3. com.permissioneverywhere
    PermissionRequest.enqueue
    1. com.permissioneverywhere.PermissionRequest.enqueue(PermissionRequest.java:61)
    1 frame
  4. com.shygunsys.pocketcyber
    TShygunSyncService.doInBackground
    1. com.shygunsys.pocketcyber.locationservice.TLocationManager.updateLocation(TLocationManager.java:153)
    2. com.shygunsys.pocketcyber.locationservice.TLocationManager.reset(TLocationManager.java:348)
    3. com.shygunsys.pocketcyber.syncService.ShygunLocationSyncServicePost.DoSync(ShygunLocationSyncServicePost.java:88)
    4. com.shygunsys.pocketcyber.syncService.TShygunSyncService.doInBackground(TShygunSyncService.java:139)
    5. com.shygunsys.pocketcyber.syncService.TShygunSyncService.doInBackground(TShygunSyncService.java:33)
    5 frames
  5. Android Platform
    AsyncTask$2.call
    1. android.os.AsyncTask$2.call(AsyncTask.java:295)
    1 frame
  6. Java RT
    FutureTask.run
    1. java.util.concurrent.FutureTask.run(FutureTask.java:237)
    1 frame
  7. Android Platform
    AsyncTask$SerialExecutor$1.run
    1. android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
    1 frame
  8. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
    3. java.lang.Thread.run(Thread.java:818)
    3 frames