Here is my take on it:
An activity is a self contained thing, like a mini program. You don't
pass complex data structures between activities. All the data that
goes to/from an Activity gets passes through an intent. An activity
can be called from another program through an intent. So an activity
is a self contained thing and a View is just something you can see.
If 2 pieces of a program are very tightly bound in that they share
some internal data and/or each part of the program can not logically
be instantiated by itself then it is not a new activity just a new
view.
Examples:
A database of car maintaince records might have a few reports that it
displays and a "enter a new record" screen. In this case the "enter
new record" screen and the reports could in theory get instantiated
outside the context of the rest of the program and therefore would be
a good candidate for separate activities.
A 3d modeling/editing program that lets you open windows that allow
you to edit some of the 3d model data. Since the 3d model data is kept
in memory and the edit screen is only editing a small piece of it, and
the edit screen makes no sense outside the context model screen. This
would be best done with separate views.
This thing of having your program broken up in to mini programs
(activities) that are callable by other programs is really new to me,
but the more i understand it the more I realize it is a really
powerful thing to be able to integrate parts of other programs in to
my own.
On Dec 10, 4:50 pm, Kanizares <[email protected]> wrote:
> Yes, same question from me. I currently am building an app that has
> certain repetitive screens (e.g. drill-down through lists of items).
> Is a ViewFlipper or multiple Activities the better way to go?
>
> cheers
> Kanizares
>
> On Nov 10, 4:26 pm, "[email protected]" <[email protected]> wrote:
>
>
>
> > I have a question with respect to best practices in android? Which one
> > is more efficient? A ViewFlipper to go through multiple defined
> > layouts or have an activity for each layout and one main layout.
> > Please let me know if my question is not clear.
>
> > Thanks
> > Phani
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en