ui-thread Questions

1

Solved

I just answered a question about whether a Task can update the UI. As I played with my code, I realized I'm not clear myself on a few things. If I have a windows form with one control txtHello on ...
Grazier asked 7/8, 2015 at 21:11

2

Solved

I need to update UI after certain time period, for which I have create a timer schedule and inside it I am calling the runOnUiThread. timer.scheduleAtFixedRate(new TimerTask() { public void run...
Swordfish asked 4/1, 2012 at 19:43

2

I've seen few questions nearly identical to mine, but I couldn't find a complete answer that satisfies all my doubts.. so here I am.. Suppose that you have an activity with an inner class that exte...
Germinant asked 24/8, 2012 at 21:41

3

Solved

I have looked through many examples/tutorials of using SQLite in Android. Let's say you have an app that uses SQLite, ContentProvider, CursorLoader, a custom CursorAdapter. Now all major examples o...
Arcturus asked 27/10, 2014 at 9:34

2

Solved

I add Markers to a googleMap from an ArrayList of Objects. There are about 250 markers; I even have to convert them to bitmaps to customize them. It's a pretty resource intensive task. BUT It serio...
Dardar asked 27/8, 2014 at 0:32

3

Solved

We are developing a WPF application which will open a number of reports at the same time (just like a typical MDI application such as Excel or Visual Studio). Although it is possible to have the da...
Multistage asked 12/9, 2012 at 11:58

5

Solved

Everything is in the title. On the official documentations it is stated that Note that services, like other application objects, run in the main thread of their hosting process and AsyncTask only ...
Philander asked 1/5, 2010 at 16:19

1

Solved

E.g.: you gonna do something that will take a few seconds and don't wanna freeze your UI thred, right? You could use an AsyncTask but you don't wanna create a external (or inner) class to sol...

4

Is there any way on Android to know, if the thread running my code, is the UI Thread or not ? In swing there was SwingUtilities.isEventDispatchThread() to tell me if i am on the UI Thread, or not. ...
Precocious asked 12/10, 2012 at 9:15

3

Solved

Can someone explain to me what exactly the UI thread is? On developer.android.com it says about the runOnUiThread function public final void runOnUiThread (Runnable action) Since: API Level 1...
Eterne asked 6/9, 2010 at 15:20

2

Solved

Normally an error while doing something on the UI thread from another thread I thought, but I don't get what I'm doing wrong. The error seems only to appear when the phone is travelling, so with a ...
Secondbest asked 17/5, 2013 at 2:5

3

Solved

I have a class, that subscribes to an event via PRISMs event aggregator. As it is somewhat hard to mock the event aggregator as noted here, I just instantiate a real one and pass it to the system ...
Redan asked 3/3, 2010 at 21:37

1

Solved

I need to add lots of views in a loop, while this fragment does that, the app will also have a navigation drawer and action bar where the user can do things. so I would like this process to not a)...
Wheelsman asked 25/9, 2013 at 19:49

3

Solved

Using handler wants to run periodically The count is 0, if the countis 1, else Please fix this code. mRunnable = new Runnable(){ @Override public void run() { if (count == 0) { setImage(); co...
Young asked 31/7, 2013 at 5:0

2

Solved

I have a Service running in my app.. This Service has an object for sending message to the server and a function to get that object and use it. The object is initialized from the Service and yet ...
Lowrey asked 5/2, 2013 at 8:19

2

Solved

I have application that for now starting few threads ( like 5 – 10 ) to collect data from different source . They are separated from the main GUI thread so I don’t feel any slowness in the GUI and ...
Coben asked 28/11, 2012 at 12:31

2

Solved

Scenario: I'm trying to unit test the onClick handler of my application. Onclick does a simple search against a REST API, returns the results and updates the UI. Details: Onclick executes an As...
Edwinaedwine asked 16/11, 2012 at 14:50

1

Solved

I was faced with an interesting problem. If you write the following code in the onCreate/onStart/onResume method of activity: final Button myButton = (Button)findViewById(R.id.myButton); final Tex...
Orebro asked 25/10, 2012 at 7:11

1

Solved

We are building a .NET application using WinForms (3.5). I have added a new feature recently, and started experiencing weird behavior when accessing certain controls. The problem was that some UI ...
Cur asked 20/8, 2012 at 18:2

3

Solved

The usual VB way to handle a computationally heavy task is to put it in a background worker thread, while the main thread keeps handling the UI. Say for whatever reason I needed to do this the oth...

5

I currently trying to write a component where some parts of it should run on the UI thread (explanation would be to long). So the easiest way would be to pass a control to it, and use InvokeRequire...
Janise asked 19/1, 2009 at 10:57

6

Solved

I'm new to Android development. I've be working on Swing and SWT for several years. Both Swing and SWT has a stratage to execute code in UI thread sync and async. The typical usage is doing some ti...
Matthia asked 7/2, 2012 at 8:48

1

I'm trying to follow Android best practices, so in debug mode I turn all the following on: StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build()); //det...
Snowbound asked 30/11, 2011 at 0:8

2

Solved

Could someone please explain to me why only the UI thread in Android can update the UI? Why can't any other thread update the UI?
Reede asked 12/10, 2011 at 16:11

3

Solved

I know that no thread can access the current view unless it is the UI Thread. I am wondering why? Why does it matter which thread is changing the view? Is it a security reason? This is the work aro...
Amimia asked 9/10, 2011 at 1:34

© 2022 - 2024 — McMap. All rights reserved.