Managing Android services in tabhosts or custom contexts? -


i have tabhost number of tabs need access same service through out life of application. 'best practice' suggests unbind services when pausing activity, mean disconnecting service, reconnect on selection of next tab, daft (not least because service maintains connection server). store reference service in tabhost, don't know how reference tabhost child activities. alternative extend application class , manage service there.

does have better ideas or reasons why shouldn't either of above?

thanks

extending application class alternative.

however can extend activity , make child activities inherit extended activity, way implement same code (service handling) in 1 activity(the parent).

activity -> myparentactivity -> mychildactivity1 

Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -