Questions tagged [looper]

A JQuery plugin for carousel. No coding required.

It is a JQuery carousel plugin to cycle through content with minimal coding. It has minimal transition effects and uses JQuery's animate function. Keyboard navigation is also available.

190 questions
6
votes
2 answers

Handlers initialized with Looper.getMainLooper() does not respond to message callbacks

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 initialized to listen on the Main Looper. private Handler…
Some Noob Student
  • 14,186
  • 13
  • 65
  • 103
5
votes
2 answers

A WebView in a thread can't be created

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{ lGraphWebView = new…
fox
  • 152
  • 5
  • 15
5
votes
2 answers

Android: TimerTask scheduled for repetition getting fired only once

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…
curioustechizen
  • 10,572
  • 10
  • 61
  • 110
5
votes
1 answer

How can I do non-blocking events processing on Android?

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 application I am porting is very large and can't easily be…
Ludvig A. Norin
  • 5,115
  • 7
  • 30
  • 34
5
votes
2 answers

Why main thread's Looper.loop() doesn't block UI thread?

Today I read some blogs and source code about how Handler & Looper work together. Based on what I've learnt, we can have only one Looper on each thread by using the ThreadLocal magic. Usually Handler is initiated in main thread, or else you must…
Ryan Hoo
  • 360
  • 7
  • 19
5
votes
2 answers

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

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 changing GPS location. I want the most recent…
Diego
  • 4,011
  • 10
  • 50
  • 76
4
votes
0 answers

Android Looper handler handleMessage is not called after sending a message to it (HTC EVO 3D)

I am experiencing a very strange problem: On HTC EVO 3D, sometimes, a looper does not call handleMessage after a message is sent to the looper's handler. It happens twice and very difficult to reproduce. The first time I caught it is after eight…
SXC
  • 237
  • 3
  • 8
4
votes
3 answers

get main thread's message queue and handler

How do I get the message queue of the main thread from another thread? Looper.getMainLooper() gets the main thread's looper but I am unable to find a way to get the MessageQueue for another thread's looper. Moreover, how do I get the handler for the…
r.v
  • 4,697
  • 6
  • 35
  • 57
4
votes
1 answer

Android error with realm, trying to use async. Says it's opened from a thread with no looper

I get the following error at this code: "Your Realm is opened from a thread without a Looper. Async queries need a Handler to send results of your query" at this line: "RealmResults completed =…
rosu alin
  • 5,674
  • 11
  • 69
  • 150
4
votes
0 answers

How to implement a Runnable with a non-blocking Looper/Handler

When you implement a Runnable which uses a Handler and Looper, you end up with a blocking queue for the Messages/Runnables within the run() method of your Runnable, because the loop() method blocks. Like this: public class Task1 implements Runnable…
user504342
  • 945
  • 2
  • 16
  • 36
3
votes
2 answers

MonoDroid Looper.MyQueue() hangs on some activities / Idle Handler?

I'm using MonoDroid Looper.MyQueue().AddIdleHandler() to execute some Commands when the app is in idle mode. This is working in one activity, but if I'm starting the second activity it hangs until i touch the screen or restart the first activity.…
andineupert
  • 341
  • 2
  • 6
  • 19
3
votes
1 answer

Service, Observer, and Loopers

I am trying to create an application that contains Content Observers in a remote service but kept getting the error: "Can’t create handler inside thread that has not called Looper prepare" I have done much reading on the Android Developers site as…
jjNford
  • 5,170
  • 7
  • 40
  • 64
3
votes
1 answer

Android: Pulling the Location at Regular Intervals crashing, Looper Prepare (Yes I searched!!)

I am trying to pull the Location at regular intervals and send it over the network. Before doing that I feel it's important to verify that I am pulling the location correctly! To do that I attempt to pull the location and send a Message to a…
user613592
  • 51
  • 7
3
votes
2 answers

Handler-Looper implementation in Android

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 added to the message queue. The runnable will be run…
mobiledev Alex
  • 2,228
  • 2
  • 28
  • 30
3
votes
1 answer

StrictMode confusion - how is this the wrong thread?

My issue: 12-18 17:05:03.336: DEBUG/StrictMode(2112): StrictMode policy violation; ~duration=2073 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=23 violation=2 From the factory method 12-18 17:05:03.336: DEBUG/StrictMode(2112): …
smith324
  • 13,020
  • 9
  • 37
  • 58
1
2
3
12 13