I've read at a few places that I should not be using Activities as contents of my tabs. I would like to know why this is not a recommended approach... Any suggestions?
Asked
Active
Viewed 6,627 times
7
1 Answers
4
I'd flip it around: why would you want to use activities as tabs? All you do is add overhead and complexity. Just use Views for the tabs.
If you have something that just has to be both a tab and a separate standalone activity, reuse the View.

CommonsWare
- 986,068
- 189
- 2,389
- 2,491
-
Actually I was more tempted by your tutorial (posted by Robert in the previous post)... Correct me if I'm wrong, but by using separate intents for the tabs, I will be doing an on-demand loading. So for instance, if there are three listviews, I will be loading just one... Or is it the same if I use Views as well? I am trying to understand the fundamental difference between using either approach... – Legend Oct 14 '09 at 20:36
-
So all I'm seeing is starting one huge activity versus starting an activity on demand... I could be wrong but I'd really appreciate if you can correct me... – Legend Oct 14 '09 at 20:40
-
Thanks a ton! That's exactly the way I was looking for... Just wish Java had partial classes... My main class is growing super huge now... – Legend Oct 15 '09 at 16:05
[http://www.androidguys.com/2008/12/05/tabs-with-intents/](http://www.androidguys.com/2008/12/05/tabs-with-intents/) – Robert Harvey Oct 14 '09 at 20:31