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
Post a Comment