0

I have a problem in layout. I am using TabHost in my application. In that there are 4 Tabs. In one of the Tab i have used 3 Buttons.

What I wanted to do is : When i click on one of the Button, the TabHost and the Button should remain as it is and it should display me the contents (Set according to onClickListener) in that activity itself.

Kartik Domadiya
  • 29,868
  • 19
  • 93
  • 104
  • 1
    So, we understand what you what to do, but what happens now? What is the problem? Can you post some code to show how you deal with the tabHost and what happens on in the activity? – Adinia Mar 02 '11 at 11:35
  • @Adinia : I just have code for TabHost. That is also downloaded from [link](http://developer.android.com/resources/tutorials/views/hello-tabwidget.html) In my application SongsActivity has 3 Buttons viz Classic, Pop, Love. Now when i press Classic Button, it should display me with all the classic songs. But all other things should remain as it is. – Kartik Domadiya Mar 02 '11 at 12:21

2 Answers2

1

Take a look at the answer of this question: Changing the view within the Android Tab Widget

Community
  • 1
  • 1
Adinia
  • 3,722
  • 5
  • 40
  • 58
0

Ok, but the thing i don't understand: where should it show you the buttonClick result? If you want to set the activity in tab not to reload each time, you should use .addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP) in the corresponding tabspec declaration

Vivienne Fosh
  • 1,751
  • 17
  • 24
  • I want to display it within the same activity. And I dont want to reload the tab each time. For Example in the example given in the link : i want to display the results within the SongsActivity but all other things(Buttons & Tabs) must remain in their position only. – Kartik Domadiya Mar 02 '11 at 14:05
  • Ok, and what's wrong with it? I've got what you want. What issues do you encounter currently? – Vivienne Fosh Mar 02 '11 at 14:26
  • The Application is Forcibly Closed. – Kartik Domadiya Mar 02 '11 at 14:33
  • lolwhat?) Dear sir, how would we all guess what's wrong without LogCat Logs? Please kindly provide such – Vivienne Fosh Mar 02 '11 at 15:54