0

I've got a simple logger app that I wrote for my Android phone. The problem is, periodically (seems like it happens every few days) when I turn on my phone I am confronted with a modal dialog box telling me that my app has consume X amount of CPU already, and do I want to kill it? The thing is, this generally happens some time AFTER I have stopped logging and it is just sitting there doing nothing, and moreover, this is when it is on AC power, so I don't see how battery consumption is even a concern. In any case, it is getting annoying having to constantly tell it to not kill the app. It is more concerning to think that this might still happen if I ever enable "stealth" mode on my app to track it if it is stolen, as this would alert a perpetrator and give them a chance to disable my app.

Is there some way to disable this behavior? If so, how?

2
  • 2
    This sounds like there's a bug in your app causing it to run continuously instead of stopping when it has finished. I'm afraid we can't help you with such a problem, as this isn't a programming site.
    – Dan Hulme
    Commented Mar 18, 2014 at 18:39
  • @DanHulme I have verified that is not the case to any meaningful extent; the total reported CPU usage of my app is under 2 minutes, all of this before I turned off logging.
    – Michael
    Commented Mar 18, 2014 at 19:00

1 Answer 1

1

Try running your logic in another thread or in async task's doInBackground

Not the answer you're looking for? Browse other questions tagged .