Re: [android-developers] Re: Why my service in Broadcast Receiver gone in seconds.

2016-03-25 Thread Kai Zhang
om/guide/topics/processes/process-lifecycle.html > for details on what is liable to be killed under what circumstances. > > On Saturday, March 19, 2016 at 5:53:57 AM UTC-7, Kai Zhang wrote: >> >> Hello all, >> My app runs in background. I use alarmmanager to

Re: [android-developers] Re: When I get gps location in background.I got ANR

2016-03-21 Thread Kai Zhang
.com/guide/components/services.html > Regards > > > > On Sunday, March 20, 2016 at 11:22:07 PM UTC+11, Kai Zhang wrote: >> >> Hello, >> I start a service from broadcast receiver.Then use thread.sleep in >> service's onStartCommand function.Then the ANR shows.

Re: [android-developers] Re: When I get gps location in background.I got ANR

2016-03-20 Thread Kai Zhang
https://github.com/GisKook/testservice 2016-03-20 20:17 GMT+08:00 Kai Zhang <zhangkai@gmail.com>: > Hello, > I start a service from broadcast receiver.Then use thread.sleep in > service's onStartCommand function.Then the ANR shows.the code is here( > https://

Re: [android-developers] Re: When I get gps location in background.I got ANR

2016-03-20 Thread Kai Zhang
ssi...@gmail.com>: > Hi, > > ANR usually means you are doing too much work on a UI thread, long running > tasks should be run on other non UI threads. > > Regards > > On Saturday, March 19, 2016 at 5:43:30 PM UTC+11, Kai Zhang wrote: >> >> Hello, >> I start a servi

[android-developers] Why my service in Broadcast Receiver gone in seconds.

2016-03-19 Thread Kai Zhang
Hello all, My app runs in background. I use alarmmanager to trig a alarm every minutes.When my Broadcast receiver receive the alarm I start a service.But I found that the service only last for about 4~5 seconds.I think every time the alarmmanager trig a alarm and a new Broadcast receiver

[android-developers] When I get gps location in background.I got ANR

2016-03-19 Thread Kai Zhang
Hello, I start a service(main service) from broadcast receiver(No 1).I know that If I do things more than 10s android will pop a ANR window.In case of this happen.I only request gps location for 6s.But only 6s I can not get gps location.So I register 3 broadcast receiver.The others(broadcast