5

I have created an Android application. I make it my default Activity on starting it.

My problem is that if I hard reboot or if the battery goes down, the device shuts down and my device keeps on starting that Activity and I am stuck into a boot loop.

How can I solve this problem?

Any help appreciated.

Vivek Kalkur
  • 2,200
  • 2
  • 21
  • 40
Sandeep
  • 667
  • 7
  • 25

1 Answers1

1

Well the solution is simple , make a BroadcastReceiver for a on Boot up , and a flag somewhere like ForceClosed set to TRUE, if application terminated without any error then set the flag to FALSE .

On receiving the Boot Broadcast , check if ForceClosed is TRUE , if yes , do watever you want , and then set it back to FALSE .

Tapan Thaker
  • 362
  • 5
  • 13