Lines Matching refs:thread
55 (frequently a network access) on the UI thread so the system can't
58 structure or computing the next move in a game on the UI thread. It's always important to make
63 <strong>you should not perform the work on the UI thread</strong>, but instead create a
64 worker thread and do most of the work there. This keeps the UI thread (which drives the user
86 <p>Android applications normally run entirely on a single thread by default
87 the "UI thread" or "main thread").
88 This means anything your application is doing in the UI thread that
93 <p>Therefore, any method that runs in the UI thread should do as little work
94 as possible on that thread. In particular, activities should do as little as possible to set
99 resizing bitmaps should be done in a worker thread (or in the case of databases
102 <p>The most effective way to create a worker thread for longer
110 runs on the UI thread), you can notify the user. For example:</p>
139 <p>To execute this worker thread, simply create an instance and
149 you should set the thread priority to "background" priority by calling {@link
151 android.os.Process#THREAD_PRIORITY_BACKGROUND}. If you don't set the thread to a lower priority
152 this way, then the thread could still slow down your app because it operates at the same priority
153 as the UI thread by default.</p>
156 be sure that your UI thread does not block while waiting for the worker thread to
159 thread to complete, your main thread should provide a {@link
161 Designing your application in this way will allow your app's UI thread to remain
169 called in the UI thread, applications should avoid potentially long-running
189 you might accidentally be doing on your main thread.</p>
206 thread.</li>