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

What is standard of Ui toolkit?

We can see this error when we try to change the Ui tookit in Thread not Ui thread. W/System.err: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. W/System.err: …
장원준
  • 19
  • 2
-1
votes
1 answer

Custom virtualizing panel freezes UI thread when user scrolls

I found a VirtualizingWrapPanel(VWP) project here which, I thought, could help me with optimizing my ListView scrolling performance. The listView have to has four columns and multiple rows to display the source items. So I tried to use this VWP, but…
PandrPi
  • 1
  • 2
-1
votes
2 answers

Fundamental question about synchronizing with the UI thread in Winforms using c#

I know Winforms has only one UI thread, and if you need to update it while you are on another thread, you should use invoke method. My questions is if what you are doing does not change the look of any control, would that still be accessing the UI…
-1
votes
1 answer

How to Set Current Activity for UI thread in Android using webview and ksoapcall Timer

I'm getting a E/Error: java.lang.NullPointerException when running Android Timer. How do I set current activity to run on the UI thread? Full ERROR Message: E/Error: java.lang.NullPointerException: Attempt to invoke virtual method 'void…
CraigJSte
  • 912
  • 6
  • 17
  • 33
-1
votes
1 answer

Proper way to wait all tasks while still updating the UI thread

I'm trying to download the page source from multiple urls using tasks to download multiple sites at one time. The issue is that I want to keep the UI updated as each individual task completes. When I try to wait all tasks it stops updating the UI…
Timg
  • 227
  • 1
  • 3
  • 12
-1
votes
1 answer

Holding things up while I get permissions

I have a method named getPermisions that uses a helper method named hasPermissions. I call getPermissions() in the onCreate method as follows . . . getPermissions(); //code here uses these permissions camera = Camera.open(); //but this code…
Dean Blakely
  • 3,535
  • 11
  • 51
  • 83
-1
votes
2 answers

Thread in Fragment only called once

I am trying to implement a thread that changes something on the UI in a Fragment. Therefore I need to refer to the main thread. Based on my research, I've found that the following code should do the trick: new…
ProgFroz
  • 197
  • 4
  • 17
-1
votes
2 answers

How to allow a non-activity to display dialog on activity?

This question is very similar to questions that have been asked in the past but please bear with me as it is still a unique question. Basically, I have a class that gets application permissions, and if the user does not have internet running, then…
Naman Jain
  • 321
  • 5
  • 21
-1
votes
1 answer

Update UI from another window BackgroundWorker vb.net WPF

I am working on a wpf project...I've faced similar issues in the past,but didn't get the answer to it and that's why i'm asking again :) My WPF app has 2 windows,one works as a splash screen and the 2nd one is just a basic window with a canvas.The…
Software Dev
  • 5,368
  • 5
  • 22
  • 45
-1
votes
1 answer

Again UI thread and a timer

I have a code part where I call some XML data from a server. Sometimes there is an error with the network or the server itself. So I need some error handling. For that I installed the AwesomeFonts.WPF and created a simple
Marcel Grüger
  • 885
  • 1
  • 9
  • 25
-1
votes
1 answer

Android Draw Polygone on Google Map after HTTP request

Hello I am trying to draw polygones on a google map after I get the data for them from an HTTP call. I always get the same error: FATAL EXCEPTION: OkHttp Dispatcher Process: com.example.rtuya.secmerev2, PID: 1011 …
0xtuytuy
  • 1,494
  • 6
  • 26
  • 51
-1
votes
1 answer

dilemma UI Thread or new Thread

I'm having a bunch of textviews and buttons initially set as GONE in .xml and I'm setting up code to reveal them (make them VISIBLE) one by one in short intervals. If I use UI thread, I risk "Application not responding" (or "ANR") if the interval is…
Nemanja
  • 211
  • 6
  • 16
-1
votes
1 answer

ResourcesNotFoundException: String resource ID #0x0 (No Response: UI Thread)

I am using OkHttpClient to get the Staff List (in JSON form) as response using AsyncTask Function. After getting the response in AsyncTask funtion, while inserting staff list in database, I want to show the count on the screen. but it gives…
Jawad
  • 31
  • 1
  • 1
  • 5
-1
votes
1 answer

SerialPort.Write(String) issue: Having a synchronised call with UI-Thread

I have searched and find out that SerialPort Class Events have a synchronise call with the UI-Thread, therefore; I have used Delegate with DataReceived Event to BeginInvoke on UI-Thread, below is my code for DataReceived Event, Delegate Sub…
-1
votes
2 answers

Blocking UI thread in javascript

The context here is I check whether the device's location is on or off. If it is off it gives a alert dialog to go to location settings. On click of Proceed button a call back is made to the successAlert function(below code). Once it enters…
pradeepln4
  • 131
  • 1
  • 2
  • 9
1 2 3
39
40