[android-developers] Re: Question about the use of FrameLayout

2008-12-17 Thread Satya Komatineni
I suppose if something is an activity it can be replaced with another component activity and thereby promising a certain amount of openness where it is applicable through intents etc.. On Wed, Dec 17, 2008 at 1:17 AM, Eric Chan jude...@gmail.com wrote: lol, I always argue with my mates about

[android-developers] Re: Question about the use of FrameLayout

2008-12-16 Thread Romain Guy
Such an approach would be very inefficient for several reasons. First of all it requires to inflate many resources that won't be needed right away, which will slow down your application startup time. It will also increase memory usage. Then you will defeat the history mechanism built in Android,

[android-developers] Re: Question about the use of FrameLayout

2008-12-16 Thread Dianne Hackborn
There is nothing intrinsically right or wrong with either approach. It is just as wrong to say that you shouldn't use the activity model for your UI, as it is to say that you should never switch between multiple views in the same activity. For the issue Romain is addressing, I would agree that

[android-developers] Re: Question about the use of FrameLayout

2008-12-16 Thread Romain Guy
Thanks Dianne, I should have been clearer: it is indeed perfectly fine to switch between Views, there are good reasons to do so. But replacing the Activity model is not a good one. One thing is certain, it is wrong to think that it would be an optimization. Like I said, it will only slow down

[android-developers] Re: Question about the use of FrameLayout

2008-12-16 Thread Mark
That makes complete sense. I appreciate the advice. Mark On Dec 16, 1:14 pm, Romain Guy romain...@google.com wrote: Thanks Dianne, I should have been clearer: it is indeed perfectly fine to switch between Views, there are good reasons to do so. But replacing the Activity model is not a good

[android-developers] Re: Question about the use of FrameLayout

2008-12-16 Thread Mark
There is not a single performance issue that I am trying to solve. It is more of an issue of keeping the code simple, limiting the number of Activities in my application and reducing the number of places that I have to access my content providers. Often times I have something like a Sports game

[android-developers] Re: Question about the use of FrameLayout

2008-12-16 Thread loty
Each Activity carries a lot of baggage like state management, etc which is not always applicable. I started my first Android app like a good boy from the Notepad example and very soon had a spaghetti of Activities. It got to the point that I had to click Back button 6 or 7 times to get back to my

[android-developers] Re: Question about the use of FrameLayout

2008-12-16 Thread Romain Guy
We never said every screen has to be an Activity (that's why it's called Activity and not Screen :)). Calendar is a good example of this, when you switch between the Day view to the Week view, you remain in the same activity for instance. Again, it is perfectly sound to flip views inside one

[android-developers] Re: Question about the use of FrameLayout

2008-12-16 Thread loty
Cool - I guess we were arguing on the same side of things. :) I definitely saw this in API docs somewhere and Diane just repeated it too that general rule of thumb should be new Activity for new screen and I just think that as a general rule of thumb you probably don't want to have new Activity

[android-developers] Re: Question about the use of FrameLayout

2008-12-16 Thread Dianne Hackborn
We are just arguing semantics here. Yes, there are times when it makes sense to start a new activity and times when it makes sense to change the UI in an existing one. I'm not going to give you The Rule for when these times are. That is part of designing your UI, keeping in mind the basic

[android-developers] Re: Question about the use of FrameLayout

2008-12-16 Thread Eric Chan
lol, I always argue with my mates about use activity or multiple layout views. We follow this, if menu changes with screen changes, use the activity, else employ multiple layout views 2008/12/17 Dianne Hackborn hack...@android.com We are just arguing semantics here. Yes, there are times when