Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #2834
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!newsfeeds.ihug.co.nz!lust.ihug.co.nz!ihug.co.nz!not-for-mail |
|---|---|
| From | Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Threads and UI in Android |
| Followup-To | comp.lang.java.programmer |
| Date | Mon, 04 Apr 2011 18:48:29 +1200 |
| Organization | Geek Central |
| Lines | 17 |
| Message-ID | <inbpju$298$1@lust.ihug.co.nz> (permalink) |
| References | <8vrrsdF6urU1@mid.individual.net> <8vs005F5tmU1@mid.individual.net> <inark9$gr4$7@lust.ihug.co.nz> <inb4mo$2br$1@dont-email.me> <8vt2tjFcvhU1@mid.individual.net> |
| NNTP-Posting-Host | 118-92-92-183.dsl.dyn.ihug.co.nz |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| Content-Transfer-Encoding | 8Bit |
| X-Trace | lust.ihug.co.nz 1301899710 2344 118.92.92.183 (4 Apr 2011 06:48:30 GMT) |
| X-Complaints-To | abuse@ihug.co.nz |
| NNTP-Posting-Date | Mon, 4 Apr 2011 06:48:30 +0000 (UTC) |
| User-Agent | KNode/4.4.7 |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2834 |
Followups directed to: comp.lang.java.programmer
Show key headers only | View raw
In message <8vt2tjFcvhU1@mid.individual.net>, Dirk Bruere at NeoPax wrote: > Where linkAPI.updateIncomingData(packetStr); is the offending bit since > it triggers updates on the UI thread. > > That would be where I use runOnUiThread()? OK, if it’s running in an endless loop, I guess that’s not suitable for an AsyncTask. I believe the recommended mechanism for posting actions back to the UI thread is via a Handler <http://developer.android.com/reference/android/os/Handler.html>: create this from the UI thread, pass it to the background thread, and the latter can use the post method to send back a Runnable to be executed. By the way, note that faceless background threads can be killed at any time.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Threads and UI in Android Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-03 19:16 +0100
Re: Threads and UI in Android Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-03 20:27 +0100
Re: Threads and UI in Android Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-04-04 10:16 +1200
Re: Threads and UI in Android markspace <-@.> - 2011-04-03 17:51 -0700
Re: Threads and UI in Android "John B. Matthews" <nospam@nospam.invalid> - 2011-04-03 21:50 -0400
Re: Threads and UI in Android Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-04 06:23 +0100
Re: Threads and UI in Android Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-04-04 18:48 +1200
Re: Threads and UI in Android markspace <-@.> - 2011-04-04 17:31 -0700
Re: Threads and UI in Android Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-04 19:18 +0100
Re: Threads and UI in Android markspace <-@.> - 2011-04-04 14:54 -0700
Re: Threads and UI in Android Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-04 23:41 +0100
Re: Threads and UI in Android markspace <-@.> - 2011-04-04 16:29 -0700
Re: Threads and UI in Android Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-05 00:32 +0100
Re: Threads and UI in Android markspace <-@.> - 2011-04-04 17:27 -0700
Re: Threads and UI in Android Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-05 01:30 +0100
Re: Threads and UI in Android Steve Sobol <sjsobol@JustThe.net> - 2011-04-04 18:53 -0700
Re: Threads and UI in Android Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-05 03:19 +0100
Re: Threads and UI in Android Steve Sobol <sjsobol@JustThe.net> - 2011-04-04 23:04 -0700
Re: Threads and UI in Android Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-05 08:04 +0100
Re: Threads and UI in Android markspace <-@.> - 2011-04-03 17:29 -0700
csiph-web