开发者

How to pass paramters from Activity A, to the tabs of a TabHost(B activity)?

i'm trying to pass a parameter from a activity Main, to the tabs开发者_开发百科 of a MyTabWidget activity.

How to do it?


Add data to the intent you are starting MyTabWidget activity and in onCreate() get the data.

Put example

myIntent.putInt("MyInt", 2);

Get example in onCreateMethod()

getParent().getIntent().getExtra().getInt("MyInt");


One way is to send a broadcast from the main activity and to register a BroadcastReceiver in your TabActivity. I don't think it is the best solution, but I couldn't find anything else that worked.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜