Android Activity and Service relationship - after Pause, after Stop -



Android Activity and Service relationship - after Pause, after Stop -

let's activity created , starts service s , binds s. s notifies of updates cause state of change. what happens , s after android pauses or stops a?

for instance:

does pausing automatically unbind s (thus stopping s if lastly thing bound it?) do updates s cause resumed? do updates s never passed , no error occurs? can s become aware paused or stopped? (for instance phone call a.isasleep())

also, how handle situation "right thing" happens? unbind services in onpause() , re-bind upon onresume()?

(a) unbound (s) onpause, if didn't phone call unbind method, think memory leak.

unless rebind (a) (s) onresume(), (a) note aware of (s) unless activity recreated.

depends on how sending updates. npe's can happen sure if @ reference (a) , happens destroyed while paused.

(s) aware (a) paused if have method of communicating (s) have done.

and yes, have right. should bind , unbind onresume , onpause.

android android-service

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -