简体   繁体   中英

Android - content in a tab how to change it with out losing parent tabs

Hey I am completely new to programming for android and for university I have been asked to create an app to buy sell and advertise a product. I have chosen dvd's to keep it simple. Using the tutorials on the android developer site I have created 3 tabs one for PG films one for 15 and one for 18. Now in these tabs I want to have a button that then changes the content of the tab but keeps the tabs.

I have tried so many things and the only thing I have been able to do is start a new activity but that gets rid of the tabs :( and I have tried many other things been up all night trying to work this out. If someone could just point me in the right direction to how to go about this would be great. Is it even possible?

Thanks

Well as far i understood your question,

  • You can use three separate Activities, at present, in three separate tabs.
  • Put button inside this activity, and code whatever you want on it's click, taking it as a separate one you can do whatever you want inside it.......
  • Once you are finished bind this with your tab, then it will be visible as Tab content.



Hope this will help you....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM