Sunday, December 26, 2010

[android-developers] Re: How do you manipulate content in an Activity from an external class or another Activity?

On Dec 21, 2:30 pm, Tobiah <t...@tobiah.org> wrote:
> Can one Activity manipulate the Views of another?
> Even with a class that is external to the Activity,
> it seems that I need to pass a pointer to the View
> in question around.  I have a subclass of Application
> that I could use to keep the View pointers in.  Will
> that work?  Does it sound necessary?

The other suggestions given in this post are better than your original
concept for several reasons. For one thing a View is a heavy weight
object for keeping in memory just to accomplish inter-Activity
communication. In general you want to update the Model, not the
View. When the Activity is re-started again it can update the View.
For another thing, depending on the launchMode, you might have more
than one instance of the this Activity (and thus its View).

>
> Thanks,
>
> Tobiah

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate