Questions tagged [ui-thread]

In some frameworks there's a dedicated thread that exclusively manages all UI objects. It's the developer's responsibility to use this thread for UI updates (e.g. adding, updating and removing controls).

In some frameworks (.Net, Android, iOS, Java Swing etc.) there's a dedicated thread that exclusivly creates and manages all the UI objects. Only this thread is allowed to modify UI objects (add, remove, set text on the button, etc). Other threads usually just post a request to make such modifications.

UI thread must never be paused for long with slow task (like communication over network or something computation intensive) as this would make all GUI non-responsive.

References

599 questions
0
votes
2 answers

Updates from C thread leads to Choreographer skipping frames

I have a C thread that is making requests and receiving updates from a server. The updates are sent to Java through JNI calls. My problem happens when I'm receiving a player's inventory which can contain up to 100 items (100 responses from the…
Fr4nz
  • 1,616
  • 6
  • 24
  • 33
0
votes
2 answers

Tracking down modifications to adapter data not on UI thread

I have just inherited a very large code base of probably around 100 activities. It seems the past developers didn't understand how to only update adapter data on the UI thread and remember to notify that the data set changed. In bugsense I have many…
w.donahue
  • 10,790
  • 13
  • 56
  • 78
0
votes
1 answer

How to access soundPool from a thread other than main/UI?

I have my main Activity class, a Renderer class and my custom soundPool class (called soundMan) and I can create and access SoundPool(I.E. soundMan) objects within my Activity class without too many problems. However, this isn't much good to me, I…
Zippy
  • 3,826
  • 5
  • 43
  • 96
0
votes
2 answers

Android Not Responding throws in Service

I'm developing an app that should track user location from time to time (e.g. every 20 seconds) and at each minute send those locations to a web services. To achieve that, I've created a producer consumer structure where each task is an android …
0
votes
1 answer

Updating background of ListView Items when Adapter data changes

I have an application which lists items in a ListFragment. Each item has a different background color based on the item status. The adapter is subclassed from a SimpleCursorAdapter, because the items are stored in SQL. The editing of these items…
0
votes
3 answers

Updating swt ui from another thread every second

I am working on a SWT java project for MAC OS, i need to add a label on SWT UI where i have to show the current time, updating on every second. I tried it i.e. final Label lblNewLabel_1 = new Label(composite, SWT.CENTER); FormData fd_lblNewLabel_1 =…
Mukesh Kumar Singh
  • 4,512
  • 2
  • 22
  • 30
0
votes
1 answer

Android: Toggle button doesnt update

I'm having some problems trying to set togglebutton (LeftLightButton) state and text after receiving value 1 at novo.charAt(0) for example. The main idea is, i click the button, it makes webview.loadUrl, and if the page changes to what i expected…
Carlcox89
  • 583
  • 1
  • 4
  • 9
0
votes
1 answer

use StyledText.append() from other thread at high speed

I am writing a desktop app using SWT which receive log data from network at high speed rate (nearly 100 packet per second). Each packet contains a line which must be appended to a StyledText. Since I receive packets in non-UI thread, I have to use…
MHM
  • 854
  • 1
  • 9
  • 17
0
votes
1 answer

CustomAdapter java.lang.NullPointerException on PostEcecute

I have a an application which retrieves data from a database and displays it with a CustomListView. When the app is going to show the ListView it crashes with this log: 03-28 13:22:16.963: E/AndroidRuntime(853):…
Eulante
  • 309
  • 2
  • 4
  • 15
0
votes
2 answers

How to print on UI and then make UI Thread wait for sometime in the same Click event in Windows phone app

I have a case where, I need to print something in textbox1 then wait for a second, make an image visible and then again wait for a second then print something in textbox2 in one button click. When I wrote a sleep after the printing in textbox1 in…
AdCan
  • 127
  • 2
  • 10
0
votes
1 answer

Invalidating and ImageView outside of the MainActivity thread

My MainActivity's contentView/View can be refresh by simply using invalidate() anywhere after calling: setContentView(R.layout.activity_main); But if I were to call a Dialog in my item select: @Override public boolean…
Androidus
  • 67
  • 1
  • 6
0
votes
1 answer

what does it mean when an exception properly handled by the UI thread causes the Windows Form application to quietly exit?

My understanding is that in a windows forms application if the UI thread throws an exception and it is not handled by user code the application will crash in a manner that is obvious to the user. (A message will appear on the screen indicating that…
J Smith
  • 2,375
  • 3
  • 18
  • 36
0
votes
1 answer

Android UI thread time issue

I have a question regarding the UI Thread in Android: My activity extends AsyncTask to do some calculations on wave file. If I run the application once, it takes around 15 min to finish. This is not problem for me. I want to start the process…
Mardini
  • 65
  • 1
  • 7
0
votes
3 answers

Timed event to change UI?

I've looked around, but I'm not quite sure how this would work, and the only thread that was really close to what I'm looking for had 404'd information. On an activity, I have four images laid out. I want them to change every 15 seconds to a…
Paul Ruiz
  • 2,396
  • 3
  • 27
  • 47
0
votes
0 answers

Network connection and UI views change in same method

I'm having problem with an AsyncTask in my app. I load some dat in doInBackground(), and with that data (contains a link to download an image) I fill a ListView. My idea was to fill the ListView in onPostExecute(), but I can't because the adapter…
Jon Zangitu
  • 957
  • 1
  • 15
  • 30