Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #2810

Re: Threads and UI in Android

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news2.arglkargh.de!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Dirk Bruere at NeoPax <dirk.bruere@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: Threads and UI in Android
Date Sun, 03 Apr 2011 20:27:14 +0100
Organization Dirk Bruere at Neopax
Lines 25
Message-ID <8vs005F5tmU1@mid.individual.net> (permalink)
References <8vrrsdF6urU1@mid.individual.net>
Reply-To dirk.bruere@gmail.com
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net +u9AKcLISd8JMAcmBglvyQxkIHKtwscRTHpCov4GPRL7Ysl6Us
Cancel-Lock sha1:Lw3wZa5o8wvrYJfM0B77lpno0PI=
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
In-Reply-To <8vrrsdF6urU1@mid.individual.net>
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2810

Show key headers only | View raw


On 03/04/2011 19:16, Dirk Bruere at NeoPax wrote:
> Part of the problem I have been having with adding data to a listview
> stems from the threads I have running. Specifically, I have a thread
> that constantly checks for messages coming over the Wifi/LAN. When it
> finds one it loads the datagram, then calls a static method from a class
> BlinkAPI which calls other BlinkAPI methods which loads the data into
> arrays.
>
> So far so good - no problems.
> However, if the Android ListView in the UI is to be updated with this
> data there is a problem. I cannot go in and do stuff to the ListView
> from BlinkAPI or I get a message about "called from wrong thread".
>
> Given that loading up Listviews, adapters etc should be done from the
> same UI thread, how best to put a "break" between my LAN thread and the
> UI thread?
>

It would seem the answer is in here somewhere
http://developer.android.com/resources/articles/painless-threading.html

-- 
Dirk

http://www.neopax.com/technomage/ - My new book - Magick and Technology

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

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