Why you don't create an external adapter, saying that I mean, an
adapter not created/instantiated as an inner adapter of your
activity?

On Jan 13, 1:55 am, galapogos <[email protected]> wrote:
> Thanks. How would I use this model for ArrayAdapters across several
> activities?
>
> Currently, I define my ArrayAdapter class in 1 .java file, declare/
> initialize it in my main activity's onCreate() method, generate the
> list that binds to the adapter in a background thread in my main
> activity (this takes up to half a minute), and starts a Runnable in
> the UI thread to call notifyDataSetchanged() to update the adapter
> once the list generation has completed.
>
> Meanwhile, the other activities run their own background threads that
> wait for the main activity's background thread to notify them of list
> generation completion, then in the UI thread filters the adapter to
> get specific subsets of the full list and displays them in their
> activities.
>
> I've some problems with this approach:
>
> 1. It seems too complicated - I'm creating 1 thread for each activity,
> which then starts a Runnable in the UI thread to access the adapter
> (accessing the adapter from the background threads lead to runtime
> errors).
> 2. I get occasional force closes with the following error message in
> logcat: "The content of the adapter has changed but ListView  did not
> receive a notification. Make sure the content of your adapter is not
> modified from a background thread, but only from the UI thread."
>
> On Jan 12, 10:55 am, Kristopher Micinski <[email protected]>
> wrote:
>
>
>
>
>
>
>
> > On Wed, Jan 11, 2012 at 9:46 PM,galapogos<[email protected]> wrote:
> > > Hi,
>
> > > I'm not aware of the singleton model. Are there any guides for it?
>
> > > Thanks.
>
> > the "singleton model" refers to a so called "design pattern" ..., You
> > can google it to find good examples:
>
> >http://en.wikipedia.org/wiki/Singleton_pattern

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to