Hi yanamala ,
ya we can achieve that by Boolean flag
the scenario of service can destroy are:
1. when user itself can stop the service by settings->
application settings -> Running service-> then your app service
2. when the mobile switch off so service can stop.
*how can we archive:*
- Using shared preference store a Boolean value for eg: *status*
- Once service started change that flag to true
- If service is going to destroy then by default it will call ondestroy()
method in service class in that change the *status *to false
- If there is no service it will be false else it will be true
- so from that u can check is service is running or not if running leave
it else again start service
did i help u ?
Regards,
Perumal.N
On Fri, Jul 15, 2011 at 1:01 PM, yanamala siddaiah <
[email protected]> wrote:
> If service stopped by user or any other situation . I want to start
> the service again .
> or
>
> user dont want stop the service delete the option to user to stop the
> service for our app.
>
> is there any flags ..
>
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en