开发者

Android - TabActivity inner Activities

开发者 https://www.devze.com 2023-03-01 21:27 出处:网络
i\'m just struggling around with a TabActivity in my android app. I have a Service that holds a tcp socket connection to a server. The TabActivity has a connection to that service. Because all Activit

i'm just struggling around with a TabActivity in my android app. I have a Service that holds a tcp socket connection to a server. The TabActivity has a connection to that service. Because all Activities that are created in the tabs need also this connection. To get a running TabActivity i looked at Hello TabWidget. I've read, that these SubActivities are开发者_如何学Go a problem, because the interaction of this activities doesn't work that good.

My Question would be, if it's possible to get a connection between the TabActivity and the SubActivities, or would it be a better approach, to take just one activity like it is handled in this Tutorial. The problem that i see, is the size of the TabActivity, because you have to deal with the logic of all SubActivities in that class.


you can get access with following code:

ListActivity currentActivity = (ListActivity) mActivity.getLocalActivityManager().getCurrentActivity();
0

精彩评论

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