looper

A/Looper: Could not create wake pipe. errno=24

一世执手 提交于 2019-12-06 21:28:49
问题 We're building an app that does a lot of animations and downloads a lot of images. After a certain amount of transactions (a predictable number), the app is crashing with the error: A/Looper: Could not create wake pipe. errno=24 We don't use Looper in our code, but a few of the libraries we use do use Looper: ActionBarSherlock: I don't think this is the culprit facebook: I don't think this is the culprit nineoldandroid: This animation library could be the culprit volley: This is probably not

Only one Looper may be created per thread Error, Async Task

别来无恙 提交于 2019-12-06 14:48:22
The code at the bottom of this post is triggered by the following line of code. new MasterClickAsyncTask(main).execute(position); The doInBackground portion of code below calls a method containing a for loop, hence the need for Looper.prepare(). This code runs fine the first few times it is called but then it throws the following error: 10-15 22:50:24.752: ERROR/AndroidRuntime(9258): Caused by: java.lang.RuntimeException: Only one Looper may be created per thread I've tried putting Looper.getMainLooper().quit(); and a few other things like this in various parts of the AsyncTask but this has

Android: TimerTask scheduled for repetition getting fired only once

为君一笑 提交于 2019-12-06 03:19:35
问题 Ok this is a very weird problem I am having, and I'm pretty sure that I am messing up somewhere, but I can't quite figure out where. What I am trying is - Schedule a Timer to execute a TimerTask every five seconds The TimerTask in turn executes an AsyncTask (which in this case simple sleeps for a second before returning the static count of the number of AsyncTasks). Finally, the aforementioned count is updated in the UI. And of course, the appropriate Handler s and Runnable s have been used

Android: LocationManager constructor's looper

给你一囗甜甜゛ 提交于 2019-12-05 05:41:38
问题 There is the possibility to start retrieving notifications from a LocationManager with the following method: requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener, Looper looper) Documentation explains attributes with these words: provider the name of the provider with which to register minTime minimum time interval between location updates, in milliseconds minDistance minimum distance between location updates, in meters listener a LocationListener

A/Looper: Could not create wake pipe. errno=24

大憨熊 提交于 2019-12-05 02:26:14
We're building an app that does a lot of animations and downloads a lot of images. After a certain amount of transactions (a predictable number), the app is crashing with the error: A/Looper: Could not create wake pipe. errno=24 We don't use Looper in our code, but a few of the libraries we use do use Looper: ActionBarSherlock: I don't think this is the culprit facebook: I don't think this is the culprit nineoldandroid: This animation library could be the culprit volley: This is probably not the culprit Picasso: This could be the culprit Has any body experienced this Looper error with any of

Specifics on using Looper.prepare() in Android

爷,独闯天下 提交于 2019-12-04 12:13:10
问题 I'm having a bit of trouble understanding how to use the Looper prepare() / loop() / quit() logic. I have three threads: one is the UI thread, one is a game logic thread and the last is a network communication thread (a background thread, lives only while being used). The game thread has many dependencies on the results of the network calls, so I wanted to spin the network thread off of the game thread and have a Handler post the result back. Of course, since the UI thread is not involved I

Calling Looper more than once causes “sending message to a Handler on a dead thread”

送分小仙女□ 提交于 2019-12-04 05:29:15
问题 I am using an Executor [fixed thread pool] with my own ThreadFactory that adds a Looper: Handler HANDLER = new Handler(); Executor THREADS = Executors.newFixedThreadPool(THREAD_POOL_SIZE, new ThreadFactory() { @Override public Thread newThread(Runnable runnable) { return new MyThread(new Runnable() { @Override public void run() { Looper.prepare(); runnable.run(); } }); } }); private static class MyHandler extends Handler { public boolean fail; public void handleMessage(Message msg) { switch

Android: difference between getMainLooper() and Looper.myLooper()

烈酒焚心 提交于 2019-12-04 05:10:56
问题 I'm now trying to resurrect one project. There was an exception on getMainLooper()... I thought that may be there's a problem with MainLooper initialization and added Looper.prepareMainLoop() before that. Exception telling me that there's already a looper for that object was thrown... Then I tried to replace getMainLooper() with Looper.myLooper() and it worked... But I didn't understand why=) In fact I don't get the difference between this two things. I think that on the place where

Android: LocationManager constructor's looper

ぃ、小莉子 提交于 2019-12-03 21:03:52
There is the possibility to start retrieving notifications from a LocationManager with the following method: requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener, Looper looper) Documentation explains attributes with these words: provider the name of the provider with which to register minTime minimum time interval between location updates, in milliseconds minDistance minimum distance between location updates, in meters listener a LocationListener whose onLocationChanged(Location) method will be called for each location update looper a Looper

Where to “quit” with looper?

大城市里の小女人 提交于 2019-12-03 17:09:46
I have a problem with a looper. I call looper.prepare() , and after doing something it all works fine. But if I rotate the device I get an exception on the prepare. 07-12 16:40:09.760: E/activity(15809): java.lang.RuntimeException: Only one Looper may be created per thread I'm trying to quit the looper, but it doesn't do anything. Here is my AsyncTask: @Override protected String doInBackground(String... args) { try{Looper.prepare(); //here start the exception try { URL url = new URL(link); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoInput(true); conn.connect();