I left only 1 tab, inflate just 1 layout and the problem persists. Next thing to try would be create a repro app and if it doesn't work I'd have to file a bug...
On Thu, Apr 2, 2009 at 11:36 PM, Stoyan Damov <[email protected]> wrote: > Hi guys, > > First, I'm really sorry for the wtf subject but I couldn't find a way > to describe the problem in 1 sentence, so here it is... > > I have an activity which extends TabActivity and implements TabContentFactory. > For simplicity's sake I'll limit the problem to 1 tab. > > In onCreate() I do this: > > TabHost host = getTabHost(); > LayoutInflater inflater = LayoutInflater.from(this); > mSomeLayout = (LinearLayout)inflater.inflate(R.layout.some_layout, null); > > In createTabContent: > > if (tag.equals("the_tab_tag")) return mSomeLayout; > > So far, so great. I get the tab, the layout is displayed. > > > I also have a button in the layout, so I do: > > mButton = (Button)mSomeLayout.findViewById(R.id.button); > > And then I subscribe to it's click event: > > mButton.setOnClickListener(new View.OnClickListener() > { > �...@override > public void onClick(View v) > { > System.out.println("WTF"); > } > }); > > Now, here's the problem. I click the button and nothing happens. > I can for example execute the following code from elsewhere: > > mButton.setEnabled(false); > > and the button will get disabled, but when I tap it (in its *enabled* > state) - nothing happens. > > Can someone help me? Am I doing something wrong? > > If I'm not, could it be that I have another tab, where the another > inflated copy of the same layout is displayed? > However, in this layout's button's OnClickListener nothing happens as well. > > I'm really stuck, so thanks for any suggestions! > > Cheers > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" 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-developers?hl=en -~----------~----~----~----~------~----~------~--~---

