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

Invalidate programmatically piano keys on android

I have class Key that extends View and put objects of this class on layout. Key is key of piano and when it's pressed, it should change image to presses key. For this aim it has methods press() that change state, play note and calls invalidate()…
-1
votes
2 answers

onItemClicked from fragment to activity

i have a listView of item in a fragment. when i click one of the item, it will open another activity and show the details of the item. but when the progress bar is loading then the whole app crashed. EditProductActivity.java public class…
-1
votes
2 answers

Android update TextView inside dialog in runOnUiThread

I have been spending couple hours to try to update the textview inside the dialog, but failed. When the option is clicked, there are new dialog is shown, and inside the dialog, there are textviews and button, when I click the button, the textview…
-2
votes
2 answers

Best way handle result from thread on UI

I want to save data to DB in new Thread and after that show toast on the UI. Method for saving: public void addToBasket(String text) { new Thread(() -> { //emulate save try { …
ip696
  • 6,574
  • 12
  • 65
  • 128
-2
votes
2 answers

runOnUiThread not updating listview

I think ive looked at almost all threads wont seem to work. Ive got a chat and im trying to update the list view every second im doing it on another thread however, im using runOnUiThread though it still wont update im logging the return and it…
-3
votes
1 answer

New to Android: no screen update via runnable thread or no screen at all. Need some hints

I have dificulties with my app. I'm stuck and have no idea how to resolve my issue which is either no update of buton graphic on receive of UDP data (done by runnable thread) or no graphic at all - just empty screen. Application is avaliable here…
-4
votes
3 answers

What is the difference between Handler vs runOnUiThread?

I come across both runOnUiThread and Handlers, but to me its still seems to be a doubt as on which facts do they differ exactly. What would be the best way to update UI? Should I use runOnUiThread or Handler? Already gone through link. Still not…
1 2 3
12
13