[android-developers] Re: TabActivity Lifecycle

2009-11-20 Thread JasonMP
Reason for confusion: I start my app and it loads to default TAB1. I select TAB2 at the top and it switches to TAB2...in my onResume() for TAB2 I display a Toast Hello and it is displayed. I go back to TAB1everything ok here. i go back to TAB2no Toast displayed from the onResume().

Re: [android-developers] Re: TabActivity Lifecycle

2009-11-20 Thread Mark Murphy
JasonMP wrote: Reason for confusion: I start my app and it loads to default TAB1. I select TAB2 at the top and it switches to TAB2...in my onResume() for TAB2 I display a Toast Hello and it is displayed. I take it that TAB2 is using an Intent to load an activity in the contents of the

Re: [android-developers] Re: TabActivity Lifecycle

2009-11-20 Thread Jason Mallet-Prevost
Hi Mark, I owe you one after today haha. So in order to keep it all together in the same activity I would just create a separate Layout in my XML file and give it an ID I can pass to the TabHost? And then since its all in the same activity I can use onTabChanged() to run any updates to my

Re: [android-developers] Re: TabActivity Lifecycle

2009-11-20 Thread Mark Murphy
Jason Mallet-Prevost wrote: Hi Mark, I owe you one after today haha. So in order to keep it all together in the same activity I would just create a separate Layout in my XML file and give it an ID I can pass to the TabHost? And then since its all in the same activity I can use onTabChanged()

Re: [android-developers] Re: TabActivity Lifecycle

2009-11-20 Thread Mark Murphy
Jason Mallet-Prevost wrote: Ok, I'm running into a hitch. Using setListAdapter() inside my TabActivity is making Android upset. Is there some other way to populate a tab with a ListView? Step #1: Get the ListView via findViewById(), like any other widget Step #2: Call setAdapter() on the

Re: [android-developers] Re: TabActivity Lifecycle

2009-11-20 Thread Jason Proctor
Please, the order of these steps is important -- we don't want any accidents related to CUI (Coding Under the Influence). not necessarily -- http://xkcd.com/323/ :-) -- jason.vp.engineering.particle -- You received this message because you are subscribed to the Google Groups Android

Re: [android-developers] Re: TabActivity Lifecycle

2009-11-20 Thread Jason Mallet-Prevost
Yeah, I think I got a little carried away there. I slowed down and got it figured out. Thanks again Mark. On Fri, Nov 20, 2009 at 3:32 PM, Jason Proctor jason.android.li...@gmail.com wrote: Please, the order of these steps is important -- we don't want any accidents related to CUI (Coding

[android-developers] Re: TabActivity Lifecycle

2009-11-20 Thread JasonMP
Heres another concern. I previously had 2 separate contextmenus and 2 separate options menus for my first tab and my second tab. Now that they are in the same activity do they have to share the same menus? I'm guessing I can always run a switch statement or something when I open the menu based

Re: [android-developers] Re: TabActivity Lifecycle

2009-11-20 Thread Mark Murphy
JasonMP wrote: Heres another concern. I previously had 2 separate contextmenus and 2 separate options menus for my first tab and my second tab. Now that they are in the same activity do they have to share the same menus? Option menu, yes; context menu, no. Option menus are per activity.

Re: [android-developers] Re: TabActivity Lifecycle

2009-11-20 Thread Jason Mallet-Prevost
Yeah, I had a separate menu in each of my Tabs, and so far they worked flawlessly. I'll have to read up on context menus a little more when I get the chance. Right now I have 2 Views with contextMenus called as registerForContextMenu(View1); and registerForContextMenu(View2); and theyre both

Re: [android-developers] Re: TabActivity Lifecycle

2009-11-20 Thread Mark Murphy
Jason Mallet-Prevost wrote: I'll have to read up on context menus a little more when I get the chance. Right now I have 2 Views with contextMenus called as registerForContextMenu(View1); and registerForContextMenu(View2); and theyre both pulling up the same menu. onCreateContextMenu() is