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
0
votes
1 answer

Interrupt a thread while loop using message from UI

I'm sure the solution to my problem will be one of those "duh" moments, but I'm stuck so any helpful hints would be gratefully received. Problem: I have a UI with a background thread. The UI has a start/stop button to initiate and then stop a…
0
votes
1 answer

Check for internet connection constantly, and if connected, running code (Android)

I would like to constantly check for internet connection and change TextView if connection appears or disappears. But the TextView doesn't change until I refresh the application. Here's my current code: TextView offline; public void run() { …
0
votes
2 answers

Android: is it possible to restart Thread's Looper?

I have a simple question: is it possible to restart (re- loop()) thread's Looper if it was previously quit. For instance, i have design my thread as follow: public class ProvaThread extends Thread implements Runnable{ public void run(){ …
user1709805
  • 2,028
  • 3
  • 19
  • 26
0
votes
1 answer

use Looper.prepare to display dialog window

I want to display a dialog window after execution of a work, AND progress dialog should be displayed untill the work is finished.so i try to use thread in following code. ProgressDialog dialog=new ProgressDialog(SampActivity.this); …
krishna
  • 4,069
  • 2
  • 29
  • 56
0
votes
2 answers

Looper not called outside the Thread class

I am learning how to use Looper and Handler class in android development http://developer.android.com/reference/android/os/Looper.html The example given in the android development is not clear to understand what is the usage and the how to use it.I…
user1494052
  • 47
  • 1
  • 7
0
votes
0 answers

Stop current playing video and play another video in a Videoview in android

I am using VideoView to play video files. Now i want to stop current playing video and play another video file.. I used videoview.stopPlayback(); then set new URI to that videovideo and start play but 'm getting…
Arjun Kanti
  • 101
  • 2
  • 4
  • 12
0
votes
1 answer

Android Threads and Messaging

I'm working on an Android app that uses uses a background worker thread. I need to be able to send messages to the thread from the activity, but I can't quite figure it out. I have one activity, and one thread to do work in the background. I want to…
tfrederick74656
  • 229
  • 3
  • 12
0
votes
4 answers

Using looper inside AsyncTask

I want to display a progress dialog while my video is being loaded and I used AsyncTask but got the following error: cant create handler inside thread that has not called looper.prepare then I tried to use looper inside it and still no luck (as it…
Nima K
  • 995
  • 1
  • 8
  • 15
0
votes
0 answers

LocationManager requestLocationUpdates

I wrote the following code, in order to have callbacks on a thread when a location update is received (this is the main thread): Handler handler; // this Handler is initialized in the following thread Runnable r = new Runnable() { public void…
Massimo
  • 3,436
  • 4
  • 40
  • 68
0
votes
2 answers

Where/how I can get a Looper?

Where/how I can get a Looper according to the C++ standard or C++ standard libraries ? I need to design my own callback system and, of course, I need this one to manage my queue and my components. A looper is something that given a frequency does 1…
axis
  • 874
  • 2
  • 7
  • 13
0
votes
2 answers

Asynctask from loop gives error on 2.3 and older

Lately, I've encountered more and more errors that may seem easy to someone with more experience, but are quite hard for me to figure out. I'm trying to create a background service that checks for new feed entries each X minutes. Hence, I'm starting…
0
votes
3 answers

Thread, can't create handler inside thread that not called looper.prepare

I am getting the "can't create handler inside thread that not called looper.prepare" error when trying to call, locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locListener); However if I don't call it inside a thread( the run()…
user340
  • 375
  • 12
  • 28
0
votes
2 answers

Android Handler.getLooper() returns null

I have following problem. I have this implementation of my Thread with Looper. public class GeoLocationThread extends Thread{ public Handler handler; private General general; public void run(){ Looper.prepare(); handler = new…
ziky90
  • 2,627
  • 4
  • 33
  • 47
0
votes
1 answer

How to obtain the handler for a secondary activity started by a first activity using an intent?

I have a main activity in my project from which i am starting a secondary activity using an intent. On a separate thread, I want to get the handler of the second activity for send some control messages to the second activity. How can i receive the…
0
votes
2 answers

How to get an AlertDialog to work, while background is rendering, and not crash the app?

Here is the source: package ff.ff; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.graphics.Canvas; import android.os.Bundle; import…
tom_mai78101
  • 2,383
  • 2
  • 32
  • 59
1 2 3
12
13