{"action":"created","issue":{"url":"https://api.github.com/repos/kaknazaveshtakipishi/PermissionEverywhere/issues/6","repository_url":"https://api.github.com/repos/kaknazaveshtakipishi/PermissionEverywhere","labels_url":"https://api.github.com/repos/kaknazaveshtakipishi/PermissionEverywhere/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/kaknazaveshtakipishi/PermissionEverywhere/issues/6/comments","events_url":"https://api.github.com/repos/kaknazaveshtakipishi/PermissionEverywhere/issues/6/events","html_url":"https://github.com/kaknazaveshtakipishi/PermissionEverywhere/issues/6","id":169844577,"number":6,"title":"Can't create handler inside thread that has not called Looper.prepare()","user":{"login":"muhammad-naderi","id":8791318,"avatar_url":"https://avatars.githubusercontent.com/u/8791318?v=3","gravatar_id":"","url":"https://api.github.com/users/muhammad-naderi","html_url":"https://github.com/muhammad-naderi","followers_url":"https://api.github.com/users/muhammad-naderi/followers","following_url":"https://api.github.com/users/muhammad-naderi/following{/other_user}","gists_url":"https://api.github.com/users/muhammad-naderi/gists{/gist_id}","starred_url":"https://api.github.com/users/muhammad-naderi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muhammad-naderi/subscriptions","organizations_url":"https://api.github.com/users/muhammad-naderi/orgs","repos_url":"https://api.github.com/users/muhammad-naderi/repos","events_url":"https://api.github.com/users/muhammad-naderi/events{/privacy}","received_events_url":"https://api.github.com/users/muhammad-naderi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-08T05:12:55Z","updated_at":"2016-08-08T05:35:47Z","closed_at":"2016-08-08T05:35:47Z","body":"Hi, \r\n\r\nas far as I understand, this library is useful when we need a permission from a service, and most of the times when I have services in background I do not have access to a UI context, and I use the application context.\r\n\r\nand it is giving me this exception:\r\n\r\n```\r\n[java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()\r\n                                                                               at android.os.Handler.<init>(Handler.java:200)\r\n                                                                               at android.os.Handler.<init>(Handler.java:114)\r\n                                                                               at com.permissioneverywhere.PermissionRequest.enqueue(PermissionRequest.java:61)\r\n                                                                               at com.shygunsys.pocketcyber.locationservice.TLocationManager.updateLocation(TLocationManager.java:153)\r\n                                                                               at com.shygunsys.pocketcyber.locationservice.TLocationManager.reset(TLocationManager.java:348)\r\n                                                                               at com.shygunsys.pocketcyber.syncService.ShygunLocationSyncServicePost.DoSync(ShygunLocationSyncServicePost.java:88)\r\n                                                                               at com.shygunsys.pocketcyber.syncService.TShygunSyncService.doInBackground(TShygunSyncService.java:139)\r\n                                                                               at com.shygunsys.pocketcyber.syncService.TShygunSyncService.doInBackground(TShygunSyncService.java:33)\r\n                                                                               at android.os.AsyncTask$2.call(AsyncTask.java:295)\r\n                                                                               at java.util.concurrent.FutureTask.run(FutureTask.java:237)\r\n                                                                               at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)\r\n                                                                               at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)\r\n                                                                               at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)\r\n                                                                               at java.lang.Thread.run(Thread.java:818)]\r\n```\r\n\r\nany idea how to resolve it?"},"comment":{"url":"https://api.github.com/repos/kaknazaveshtakipishi/PermissionEverywhere/issues/comments/238145678","html_url":"https://github.com/kaknazaveshtakipishi/PermissionEverywhere/issues/6#issuecomment-238145678","issue_url":"https://api.github.com/repos/kaknazaveshtakipishi/PermissionEverywhere/issues/6","id":238145678,"user":{"login":"farruxx","id":5796491,"avatar_url":"https://avatars.githubusercontent.com/u/5796491?v=3","gravatar_id":"","url":"https://api.github.com/users/farruxx","html_url":"https://github.com/farruxx","followers_url":"https://api.github.com/users/farruxx/followers","following_url":"https://api.github.com/users/farruxx/following{/other_user}","gists_url":"https://api.github.com/users/farruxx/gists{/gist_id}","starred_url":"https://api.github.com/users/farruxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farruxx/subscriptions","organizations_url":"https://api.github.com/users/farruxx/orgs","repos_url":"https://api.github.com/users/farruxx/repos","events_url":"https://api.github.com/users/farruxx/events{/privacy}","received_events_url":"https://api.github.com/users/farruxx/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T05:35:47Z","updated_at":"2016-08-08T05:35:47Z","body":"@muhammad-naderi in your case, try to use method `call()` instead of `enqueue()`. I have just tested, it works.(Also I have no ideas why it works)"}}
{"actor":{"display_login":"farruxx"}}