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

Sample of handler not working for some reason

Here is my Main Activity: package com.eddieharari.threadtest; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.os.Message; import android.util.Log; import android.view.View; import…
Thegremlin
  • 89
  • 7
0
votes
0 answers

Why the looper and handel when i sync a device shows many errors and makes that the app close instant?

The problem that i have it's that when i try to run the app in a device works well and the code builds well but when the apk is installed, then close because say that didn't works well. And in the part of android run time, apears the message. I try…
ignasi
  • 1
0
votes
0 answers

Can't make Realm test with a listener to run

I'm currently trying to run an instrumented test of Realm with a listener. I'm pretty new to Android and have read the minimal Realm documentation and SO questions but really can't figure this out. I have this realm test class that I subclass for…
lorenzo
  • 1,487
  • 1
  • 17
  • 25
0
votes
1 answer

Create a Handler Inside Thread in Android

I tried to show the toast from the thread. Toast.makeText(activity.getApplicationContext(), "This is the Toast message", Toast.LENGTH_LONG).show(); but throws the exception java.lang.RuntimeException:Can't create a handler inside thread that has…
Bikesh
  • 91
  • 4
  • 13
0
votes
0 answers

how to quite a Looper of a worker thread

I wrote the below code to better understand the Handler and the Looper. I would liek to know how can I quit the Looper on occurence of a specific condition for example, when a counter reaches a specific limit. In the below code, I want to call…
Amrmsmb
  • 1
  • 27
  • 104
  • 226
0
votes
1 answer

HandlerThread throws RuntimeException Only one Looper may be created per thread

This crash report only contains system trace, because it happens in the HandlerThread: java.lang.RuntimeException: Only one Looper may be created per thread at android.os.Looper.prepare(Looper.java:107) at…
mianlaoshu
  • 2,342
  • 3
  • 27
  • 48
0
votes
0 answers

How can I pass a bitmap from a worker thread to the main thread using handler and executor?

This is my run() method of a worker thread which is executed using an executor: @Override public void run() { Looper.prepare(); Log.i(TAG, "Starting Thread" ); final Bitmap bitmap=getBitmap(imageUrl); handler=new Handler(); …
AMAN JAIN
  • 1
  • 6
0
votes
0 answers

Who generated Main Thread and Looper running in the process where Service exists?

In the case of operating Service in a process different from Activity by using "android:proces", I confirmed that Looper and MainThread also exists in the process where Service exists. Who generated Main Thread and Looper running in the process…
0
votes
1 answer

How to import classes implementing annotation @RunTestInLooperThread

I'm new to Realm and Android Programming. I have a problem implementing JUnit tests of async login (SyncUser.loginAsync). When I run the test I get the error: "Asynchronous login is only possible from looper threads. Realm cannot be automatically…
Selvaggia
  • 1
  • 1
0
votes
1 answer

What are looper, handler and other terms related to android threads? How are these classes related?

Where can I find detailed explanation of threads like timer, async task, handler, looper etc in android?
Ujjwal Chadha
  • 133
  • 2
  • 8
0
votes
1 answer

Android additional threads and Looper

I am writing a Android application which reads data from a SQLite Database and then displays the data on a next screen. Whenever I was doing a query on the database I would get an error message that too much work is being done on the main thread. I…
Owen Nel
  • 367
  • 3
  • 9
  • 21
0
votes
0 answers

Service with one background task and another one pending

I need to make the IntentService to process only one pending task (the last one). For example if the service is already running and it receive another task then that task is kept in the queue and run after the current one ended. The problem is that…
chris
  • 313
  • 2
  • 12
0
votes
2 answers

Android handler only sends one message

I am trying to implement a REST interface in android and I need a Thread in the background sending "I am alive" messages to an ip address. To do so I created a Thread Called RestPostThread that runs in the background while I do stuff in my UI…
Hart
  • 1
  • 3
0
votes
1 answer

What is blackberry's equivalent to Androids Looper?

Android has Looper, and iPhone has Run Loops. It seems like Blackberry would have a similar backed in facility to queue and run threads. Does anyone know if there is?
lukejduncan
  • 121
  • 4
0
votes
2 answers

Only one Looper may be created per thread

With the following code: private void showDialog(String message) { try { Looper.prepare(); Handler handler = new Handler() { @Override public void handleMessage(Message msg) { try { Uri…
IGT
  • 9
  • 2