looper Questions

6

Solved

I have checked the official Android documentation/guide for Looper, Handler and MessageQueue . But I couldn't get it. I am new to android, and got very confused with these concepts.
Ta asked 13/10, 2012 at 23:29

5

Solved

I created a class extending Thread to retrieve user location through LocationManager in a non-ui thread. I implemented this as a thread because it has to be started on request and do its work just ...
Acrolein asked 8/6, 2011 at 11:22

6

Solved

I have tasks completed by AsyncTask in background. At some point I need to issue a Toast that something is completed. I've tried and I failed because Caused by: java.lang.RuntimeException: Can't...
Dvorak asked 14/5, 2010 at 21:13

4

Solved

I have a worker thread that sits in the background, processing messages. Something like this: class Worker extends Thread { public volatile Handler handler; // actually private, of course publ...
Antigua asked 29/1, 2011 at 17:13

1

Solved

Consider the following snippet: Looper.prepare(); handler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); getLooper().quitSafely(); } }; for(in...
Juristic asked 6/3, 2015 at 22:26

2

Solved

I know the general problem of "Can't create handler inside thread that has not called Looper.prepare()" has been asked before, but I am struggling to understand how it applies in this case. I am ...
Recumbent asked 23/10, 2010 at 23:20

2

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 com...
Adjunct asked 13/7, 2011 at 3:17

2

Solved

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(1...
Suction asked 12/7, 2013 at 14:49

2

Solved

Normally an error while doing something on the UI thread from another thread I thought, but I don't get what I'm doing wrong. The error seems only to appear when the phone is travelling, so with a ...
Secondbest asked 17/5, 2013 at 2:5

2

Solved

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: Coul...
Strong asked 12/7, 2013 at 1:19

2

I have a HandlerThread, to which I keep posting a runnable every 5 seconds. Something like this: HandlerThread thread = new HandlerThread("MyThread"); thread.start(); Handler handler = new Handler...
Demagnetize asked 30/7, 2013 at 7:59

2

Solved

I am trying to implement Handlers listening on the same Looper from different threads. Below I have two Handlers, one created in the main thread, another in the child thread, however both are init...
Doubtful asked 21/3, 2013 at 2:9

1

Solved

Can anyone explain why someone should use the Android Looper feature to create a "pipeline thread" instead of making a normal thread that pulls tasks from a BlockingQueue? On the surface, it seems ...
Internee asked 9/12, 2011 at 0:7

4

I use the android.os.Handler class to perform tasks on the background. When unit testing these, I call Looper.loop() to make the test thread wait for the background task thread to do its thing. Lat...
Hellenistic asked 7/9, 2010 at 5:23

4

Solved

I don't understand why I'm getting this error. I'm using AsyncTask to run some processes in the background. I have: protected void onPreExecute() { connectionProgressDialog = new ProgressDialog...
Springhead asked 1/9, 2010 at 2:32

1

This question is about event handling on Android. It is not specific to c++. I need to process UI/OS events, without blocking when all events have been processed. The reason is that the applicat...
Ubiquitarian asked 14/2, 2011 at 15:59

1

I am using simple thread to execute the httpGet to server when a button is clicked, but I get this after execution. Button b_back = (Button) findViewById(R.id.bback); b_back.setOnClickListener(thi...
Neel asked 30/7, 2011 at 2:14

2

Solved

i have some threads in which i create some views and prepare them to be displayed. Among them i also have a WebView. This code is executed in thread: WebView lGraphWebView = null; try{ lGraphWeb...
Aletheaalethia asked 2/12, 2011 at 8:53

2

Solved

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 TimerTas...
Haim asked 11/7, 2011 at 15:16

2

Solved

I have Activity with Handler (UI thread) I start new Thread and make handler.post(new MyRunnable()) - (new work thread) Android documentation said about post method: "Causes the Runnable r to be...
Yachtsman asked 15/3, 2011 at 18:38

2

Solved

I have the following code class OverlayTask extends AsyncTask<Void, Void, Void> { @Override public void onPreExecute() { if (sites != null) { myMapView.getOverlays().remove(sites); myM...
Coronagraph asked 15/11, 2010 at 19:18
1

© 2022 - 2024 — McMap. All rights reserved.