Questions tagged [android-runonuithread]

This is a way to run the specified action on the UI thread of Android framework.

runOnUIThread is a method of an Android's Activity:
It runs the specified action on the UI thread. If the current thread is the UI thread, then the action is executed immediately. If the current thread is not the UI thread, the action is posted to the event queue of the UI thread.

Useful links

187 questions
0
votes
0 answers

Android Async crashes when called from another class

I've been trying to call an Async method from another class, but the application seems to be constantly crashing when I do so. The Async method works when I call it from within the class. I believe I've narrowed it down to when it tries to display…
0
votes
1 answer

How can use update UI Thread

I have same stock item , I want to send local database to ApiService, But when I send also I want to update ProgressBar message. I tried the code below but it just shows when all proccessing is finishing. ProgressDialog progress= new…
artemitSoft
  • 286
  • 5
  • 17
0
votes
2 answers

Remove callback not working in Handler

I have Handler.I call my function every 10 second.Code working perfect,but i can't stop handler.This is my source code handler=new Handler(); handler.post(runnable); public Runnable runnable = new Runnable() { @Override public void run() { …
BekaKK
  • 2,173
  • 6
  • 42
  • 80
0
votes
0 answers

Android Digital Clock in separate Thread

I've found some video tutorial of Tihomir RAdeff that says how to develop a simple Digital Clock as part of custom View. But it is an example of how to run the Clock drawing in UI thread using Handle and Runnable. Is it a perfect way to develop the…
0
votes
2 answers

In which situations is it acceptable to make network calls on the UI Thread?

This Question asked in Most Android Exams, but I didn't got any answer from any android forums. Thanks in advance.
Narendra Sorathiya
  • 3,770
  • 2
  • 34
  • 37
0
votes
4 answers

Android view doesn't update when trying to set values over time

I got a fragment which got a control called RingProgress which is simply a ring that fills itself according to a percentage value given. For example, if I do: ringProgress.setProgress(20); It means that 20% of the ring will now be filled. What I'm…
CodeMonkey
  • 11,196
  • 30
  • 112
  • 203
0
votes
1 answer

How does this work regarding UI thread

In the AppCompatActivity just wanted to get some feedback on this. When does this Runnable run? Is the super.onBackPressed(); posted on Main ui thread and then my Runnable is also posted to Main ui thread? which I know is a queue right. is this…
Tord Larsen
  • 2,670
  • 8
  • 33
  • 76
0
votes
1 answer

How does call app works when the call app is removed from task list (aka Overview screen) in Android?

I learned that following is Overview screen. I clicked the dialer and dialed a number and then swiped the dialer to the right. But still the call is on like this. How is this done? I am a newbie to Android programming. I am thinking if they had…
sofs1
  • 3,834
  • 11
  • 51
  • 89
0
votes
2 answers

Why does runOnUIThread still cause looper.prepare() error message

I have an Android game that uses the Libgdx game engine. I have an Android activity (mAndroidLauncher) that extends Libgdx's AndroidApplication class. There is a method that creates an Android alert dialog: mAndroidLauncher.runOnUiThread(new…
0
votes
3 answers

Android : runOnUiThread not working, working if user touches screen

When I do some processing in the background thread and wants to update the UI using runOnUiThread(), the code inside the function is running successfully without any error, but the UI gets rendered only if the user touches the screen. Otherwise,…
Kamalakannan J
  • 2,818
  • 3
  • 23
  • 51
0
votes
0 answers

Java android running asynctask

I have a modified bluetooth chat program, that displays coming data from other device on screen. That works nicely, when using arduino and sending data. Now I would like to add a feature that when on screen pops message: "EMPTYING", then it would…
0
votes
3 answers

How to Set textview in doINBackground android

I want to access a postgresql database, but I have a problem with AsyncTask and doInBackground commands. I don't know why I can't update my textview at onPostExecute. Can anyone explain me what is the problem? Here is my code: package…
Rasa
  • 11
0
votes
5 answers

what to use if i have long updating ui thread in android

I have a project which a activity have more than 1000 buttons. i am updating the background color of these buttons after taking the color information from the database. This whole process is a very big process and took 8 seconds to load my…
0
votes
2 answers

Error using setText in runInUiThread

I need a thread that waits some time then changes a text in a TextView. My search found how to use runOnUiThread I understood the first answer and tried to use it in my code but I get an error when calling setText in the thread. Here is my code…
0
votes
1 answer

Listeners don't work in OnUiThread

so i had a AsyncTask with RunOnUiThread to interactively change ui elements and add TableRows the problem is on the listeners in TableRows. only one works but the others don't. this is a simple from my code public class SearchAsync extends…