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

Android App runs in wrong UI thread after kill app?

My App have a GCMIntentService extends on GCMBaseIntentService. When received a message, I will open an activity that have a Webview on it. Here the code:GCMIntentService: public class GCMIntentService extends GCMBaseIntentService { @Override …
NghiaDao
  • 383
  • 1
  • 3
  • 14
0
votes
0 answers

UI Stucks in iOS app possible reason is FMDB query?

my apps UI stuck for several seconds for the very first time app launches (MenuPage) and when I move to Account page. It stuck while calculating some status. But I did them in background queue. I paused and looked at the debugger. Its shows this: I…
Rashad
  • 11,057
  • 4
  • 45
  • 73
0
votes
1 answer

Updating my ObservableCollection on a worker thread still hangs my UI

I have a log window in my application, when I have a few thousand logs, filtering them to include or exclude different log levels makes the UI unresponsive for a period of time from the work load. So I have tried to move the heavy lifting to a…
Douglas Gaskell
  • 9,017
  • 9
  • 71
  • 128
0
votes
2 answers

`CalledFromWrongThreadException` when calling QBChatService.login() method in QuickBlox API

I'm developing an IM app using the Quickblox API and I'm currently developing the Sign Up and Login features. Well, my problem is that everytime I try to login to the QBChatService by calling QBChatService.login() I'm getting this error from Log…
regmoraes
  • 5,329
  • 3
  • 24
  • 33
0
votes
0 answers

Does Windows Forms UI thread handle multiple backgroundworkercompleted events asynchronously or sequentially?

I have a Windows Forms app (.NET 2.0) which launches a number of BackgroundWoker threads and handles their ProgressChanged and Completed events when they are updated/finished, respectively. However, I have come across a situation that has me…
Dime
  • 41
  • 5
0
votes
1 answer

Android Studio - bringToFront must be called from the UI thread

since I've imported my Eclipse project to Android Studio I have an error concerning the bringToFront() method. protected Void doInBackground(String... num_t) { planningTitle = (TextView) findViewById(R.id.planningTitle); …
Cedric
  • 112
  • 1
  • 10
0
votes
1 answer

Starting new Thread freezes UI

I am working on an app that implements a Web Socket server. I am referring this library - https://github.com/TooTallNate/Java-WebSocket The problem is that the thread holds up the entire UI. Here is the code - package com.example.websocket; import…
Apoorva Somani
  • 515
  • 1
  • 6
  • 23
0
votes
0 answers

Why is this async/await code dead-locking?

I have the following code and while when calling it the expected way it works, it locks when I try to directly access the Result property of the task. I wasn't expecting this, especially when I specify ConfigureAwait(false). Also I'm not sure if I…
Pinco Pallino
  • 916
  • 1
  • 6
  • 18
0
votes
3 answers

Should I update UI elements from OnPostExecute of AsyncTask or not?

In my android application, I want to strictly follow the Android guidelines. So after executing the AsyncTask, I have 2 options to update the UI with the results. I can either send the results back the main thread using a call-back listener and…
allstraws
  • 129
  • 3
  • 12
0
votes
1 answer

Synchronizing UI thread with dispatched View states dependant on worker thread events?

There is an Activity and a button on it. The task is to pass white-box test for an influence of Activity consequence behaviour "Button CLICK -> Button GONE -> Activity PAUSE -> Activity RESUME" on button visability state. Naive implementation leads…
Yehor Nemov
  • 907
  • 2
  • 16
  • 31
0
votes
2 answers

Change TextView value using uithread

I'm trying to change some textview value but when it's not appeared on the screen the value don't change or when it's appeared on screen it changes and when scroll down and scroll back up it's value returns to the old one i tried the following two…
0
votes
1 answer

Picture lazy loading in android

I'm developing an App on which I have plenty of ListViews. On each ListView Item, there is a picture. In order to load the pictures from the server taking in consideration: Basic Authentication. SSL certification. I would like to know what is the…
Hubert Solecki
  • 2,611
  • 5
  • 31
  • 63
0
votes
0 answers

I use a thread for the UI display in WPF program(c#), but the CPU is high. I am not sure why

I programming a c# code, I just used a thread to display a data on the UI, once per 100 ms. But I found the CPU(not the memory) is very high, from 20% to 70% immediately. Could someone else help me for this problem? public delegate void…
Ben
  • 15
  • 4
0
votes
0 answers

Web View running on other than UI thread

I am trying to show flurry interstitial but getting following message in debug screen and I am not receiving interstitial on my screen. 07-14 15:55:31.390: W/webview(10588): java.lang.Throwable: Warning: A WebView method was called on thread…
Siddharth
  • 4,142
  • 9
  • 44
  • 90
0
votes
2 answers

Android: Background Thread set to sleep, but still blocks UITread

I created simple example in Android: on a button click, a new Thread is created run in backgroud. However when I put it to sleep (Thread.sleeps(10000)) it blocks also the UIThread. Why it blocks also the UIThread? My thread is supposed to run in…
Enrico
  • 41
  • 1
  • 4