Top "Android-handler" questions

A Handler allows you to send and process `Message` and Runnable objects associated with a thread's `MessageQueue`. Each Handler instance is associated with a single thread and that thread's message queue.

Android: How to use a Handler handleMessage and access the reference to the MainActivity

I have a service which receives a command from the Internet and launches a background thread. This thread is passed …

android android-handler
Handlers, MessageQueue, Looper, do they all run on the UI thread?

I'm trying to wrap my head around threading, and I know that I may use a Handler to post messages/…

android multithreading android-handler android-looper
Missing the android.os.handler object from Android Studio

I'm attempting to create a Handler thread in my application however Android Studio marks my text as red and will …

android import android-studio android-handler
How to cancel a handler before time in Android code?

I create 1 minute delayed timer to shutdown service if it's not completed. Looks like this: private Handler timeoutHandler = new Handler(); …

android android-handler
Why use HandlerThread in Android

In android , Handler can be used to post / handle message, if I don't use a HandlerThread (pass its Looper to …

android android-handler android-handlerthread
What is the meaning of removeCallbacks(Runnable r) in Handler in Android

I want to know what is the exact meaning of removeCallbacks(Runnable r) in Handler. I gone through its documentation …

android android-handler
How to use Handler and handleMessage in Kotlin?

Java code: private final Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { // code here } }; How to convert this …

android kotlin android-handler
Implementing AsyncQueryHandler

I am trying to implement AsyncQueryHandler because I am experiencing the same exact problem in this link but I dont …

android android-handler
Handler.postDelayed(...) does not delay the Runnable

i've implemented an OnCompletionListener by myself which looks like this: public class SongEndCompletionListener implements OnCompletionListener{ String nextView; Context actualActivity; int …

android android-mediaplayer runnable android-handler postdelayed
How to solve java.lang.RuntimeException error occured while executing doInBackground()?

I am beginner in android development, I am getting error in following code. I am calling asyn method for http …

android android-service android-handler android-internet