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

Show RadBusyIndicator during Frame Navigation WPF

For our application, we need to display the busy indicator during navigation since some controls taking time to load. Normally for long running operation i will create a separate task and will trigger busy indicator in UI Thread but in this case I…
Max_dev
  • 508
  • 7
  • 25
0
votes
2 answers

Getting cross thread Error even Used Invoke

Getting cross thread error when executing tcViewer.TabPages.Add(t) statement. Code is as below. Private Function fff(t As TabPage) tcViewer.TabPages.Add(t) 'giving cross thread error End Function Function WebBrowserThread() Dim t As…
dsi
  • 3,199
  • 12
  • 59
  • 102
0
votes
1 answer

In MFC the UI related operation (Draw paint) can be performed in worked thread?

In MFC the UI related operation (Draw paint) can be performed in worked thread? My problem is as of now the main thread is taking lot of time in drawing the UI related items. But if i can delegate the UI drawing related operation to worked thread…
GAP
  • 395
  • 1
  • 5
  • 18
0
votes
1 answer

Handle Touch Event when main queue is already occupied with heavy UI updates

I have a scrollview and table view in one screen. Both of them contain heavy data as its a trading app. So every second I receive and update in the value and call cell update. Meanwhile if the user tries scrolling the scrollview,it doesnt respond,…
0
votes
2 answers

Android appUI updating slow

In my app when a button clicked, the database is updated first, then that data is sent to the server. Before sending data that data is encrypted. The update to the db is done in one async task and the encryption and sending data is done through…
Jyothish
  • 587
  • 2
  • 8
  • 24
0
votes
1 answer

Can't create handler inside thread that has not called Looper.prepare()

EDIT: My solution was to have a constant class with this code: static EditText Port = (EditText) MainActivity.mDialog.findViewById(R.id.txtPort); static int mPort = Integer.parseInt(Port.getText().toString()); public static final int PORT =…
0
votes
1 answer

the issue of heavy access to main UI thread on Kitkat with kenBurnsView - android

I added kenburnsView to my project where i need it in the main activity. I got the kenBurnsView code from this source: KenBurnsView.java The Problem: The interesting thing that the code runs perfectly for new and old devices, but not for devices…
MBH
  • 16,271
  • 19
  • 99
  • 149
0
votes
2 answers

Deadlock - Windows Phone 8 BeginGetResponse c#

I have two processes running on my UI thread. However, when I run the first, with BeginGetStream functionality, it enters the cycle and waits for its execution and returns the result when you are ready, but in the second run, through the…
fipcurren88
  • 701
  • 5
  • 26
0
votes
1 answer

Deadlock Windows Phone 8 - UI Thread

I have two processes running on my UI thread. However, when I run the first, with BeginGetStream functionality, it enters the cycle and waits for its execution and returns the result when you are ready, but in the second run, through the…
fipcurren88
  • 701
  • 5
  • 26
0
votes
1 answer

RestKit, Core Data, Magical Record, Lots of data and Lagging UI

I got an app which stores data about restaurants. Their menu, schedule and so on. Theres ~200 restaurants in the DB by now. The app used to retrieve those places by a single shot, but it was taking too much time to load, so i decided to load the…
Alexander
  • 11
  • 4
0
votes
1 answer

Android Fragments: removeAllViews in onDestroyView

My fragment has the reference to a RelativeLayout mContentLayout. In onDestroyView() (before navigating to another fragment), I need to remove all views of this mContentLayout. I know that you should deal with UI stuff only from the UI thread, but…
Daniele B
  • 19,801
  • 29
  • 115
  • 173
0
votes
0 answers

Android CountDown Timer in UI Thread

I try to code a CountDownTimer which can be repeated several times. My code works fine... But just one time. I don't understand why the repeated action is not done :-( Here is my code : package com.bigmat.MyTimer; import…
0
votes
1 answer

Mutex Blocks UI Thread

I have background thread in my application which uses mutex like this: void bgWorker_DoWork(object sender, DoWorkEventArgs e) { MyMutex.MuImageLock.WaitOne(); foreach (var file in ImageFiles) { …
Dee Choksi
  • 125
  • 4
  • 15
0
votes
1 answer

Does Activity method called from Fragment run in the UI thread?

I have called an Activity method that updates UI from a Fragment and I get a silent CalledFromWrongThreadException that tells me Only the original thread that created a view hierarchy can touch its views. My Activity: @Override protected void…
Ali Behzadian Nejad
  • 8,804
  • 8
  • 56
  • 106
0
votes
1 answer

Combining SWT and AWT/Swing: which GUI thread to take?

Working on a large scale SWT-based application I just stumbled upon some code using the AWT/Swing bridge which totally confused me and made me think about the implications of using two GUI threads. public void createContent(final String html) { …