开发者

Get information from a activity inside a tab

开发者 https://www.devze.com 2023-03-27 15:40 出处:网络
I have a tabHost, with to tabs and an activity each one of them. In the tabHost i also have a menu, with the save action. when i press the save in the menu,

I have a tabHost, with to tabs and an activity each one of them.

In the tabHost i also have a menu, with the save action. when i press the save in the menu,

i must get all the stuff that are inside those activities, like EditText text value content, checkbox checked value. Im running throw google and i only find how to setup the tabs.. but i cant find how to do what i've describe above.

I ha开发者_开发百科ve tried usind the findViewById passing the EditText or the CheckBox that are on those activities.. the result was null..

Any thougths?

Thanks in advance.


The link above is one solution. I will repeat it here for everyone. You can then call functions in each tab's activity which writes the data.

Another option is to write to shared preferences on text change for the edit text widgets and then get that information for the tab host.

Link: Android: How to call function of Activity inside of tab from the tabhost

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号