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
3
votes
2 answers

Android: Issue using a handler and postDelayed()

I am trying to use a Handler to have some code execute in some amount of time. This works well in 2 of my classes, but I'm running on an issue with this one: One of my class extends Activity, and starts a Thread (that implements Runnable). In my…
Jary
  • 85
  • 3
  • 7
3
votes
1 answer

Android: looper/handler vs. Java Observer?

Aren't these competitors? I'm thinkin they're not, but don't see it. How about within the context of an Activity needing to learn when a Service has new xyz? Thanks!
DJC
  • 3,243
  • 3
  • 27
  • 31
3
votes
2 answers

why can I touch UI in non-uithread by looper?

thread = new Thread() { public void run() { super.run(); System.out.println("run:" + Thread.currentThread().getName()); Looper.prepare(); handler = new Handler(); …
Tony
  • 520
  • 4
  • 13
3
votes
1 answer

using a Looper in a Service is the same as using a separate thread?

In this example from the documentation (https://developer.android.com/guide/components/services.html#ExtendingService), we use the "looper" of a thread, and we use it in the Service class, and then the Service will be working as if it was in a…
Paul
  • 6,108
  • 14
  • 72
  • 128
3
votes
1 answer

Android Looper thread crashes with NullPointerException

I'm trying to get a looper thread to work but despite all attempts, it crashes. I'm not using the HandlerThread class, as I'm doing quite a bit of 802.11 related stuff in the thread itself and posting Runnables with lots of duplicate code doesn't…
user2952698
  • 159
  • 1
  • 1
  • 7
3
votes
2 answers

Source not Found on Android

Whenever I try to debug my app, Eclipse open a Class File Editor and gives a Source not Found and generally for basic Java classes (For example, Looper.class). I am really sick of this. I cannot debug well because of these Source not Founds. Is…
ciyo
  • 725
  • 4
  • 16
  • 36
3
votes
1 answer

Can I get a non-blocking Looper?

I have a Thread with a message-Looper for some Location calculation. For this i call: LocationManager.requestLocationUpdates(mProvider, mMinTime, mMinDistance, (LocationListener)this, looper); To get a valid Looper-object I prepare my Thread like…
eL.
  • 311
  • 1
  • 2
  • 15
2
votes
1 answer

Implementing LocationListener on a service thread

I'm trying to get the location updates running in a background service. The service is running a workerthread of its own doing a lot of other stuff already, like socket communication. I'd like it to also handle location updates but this seems to…
user1262805
  • 31
  • 1
  • 3
2
votes
1 answer

Android Threading - Queue runables

I try to write a little game using android and have some problems with threading. The mainloop of the game runs in this own thread and basically just does something like this: public void run() { while (true) { …
D-rk
  • 5,513
  • 1
  • 37
  • 55
2
votes
2 answers

LocationManager and Looper - only one Looper may be created per thread

I am having an issue with my app. I need to get Location Updates at certain interval's and therefore basically need to be able to control the GPS module pretty well, this is not really easy with the Android OS. Basically i need to turn the GPS on…
SeanSWatkins
  • 413
  • 4
  • 9
2
votes
1 answer

Does handler belong to thread in which it was created?

I'm relatively new to the "Looper-Handler" term. I'm pretty clear with the way they work but still confused with their architecture. I've also gone through couple of SO questions, but still I have some questions regarding them. To get them clear and…
2
votes
1 answer

Why does Android service needs to run on UI thread?

I have a probably simple question. I have an android service; where in I have created a generic service class which requests locks and executes actual (extending) service code in a separate thread. Example below: abstract public class ParentService…
Priyank
  • 14,231
  • 18
  • 78
  • 107
2
votes
0 answers

WindowManager addview not working in GcmListenerService

I'm trying to build an app that when receiving GCM message from Google's GCM server, then I can show a notification on the top of the screen like Facebook's app Messenger. My problem is: The code windowManager.addView(chatHead, params); in…
2
votes
1 answer

Android: Shutting down thread and Looper correctly?

I shut down my thread like so: theSensor.getLooper().quit(); theSensor.quit(); Still I get the error below. What do I need to do to ignore the rest of the messages? 03-14 00:42:12.237: W/MessageQueue(10027): Handler…
user1190832
2
votes
2 answers

Android threads with queue vs Handler/Looper: which one is efficient?

I have a producer-consumer situation, where I want to decide between two mechanisms to implement it. It is an audio-recording/encoding case: The producer polls device microphone ,continuously, for the recorded audio, and when an audio sample is…
Nazar Merza
  • 3,365
  • 1
  • 19
  • 19
1 2
3
12 13