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
-~----------~----~----~----~------~----~------~--~---

Reply via email to