I have a int variable witch holds the old battery value it is declared in the top of the class. The problem is that the variable is not keeping it’s value. I have tried static, volatile keywords but none of them worked.
Any ideas ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A
BroadcastReceiverregistered in the manifest via a<receiver>element will live long enough for a singleonReceive()call. Any data that it needs to keep should be stored in a file (e.g., database).A
BroadcastReceiverregistered viaregisterReceiver()from anActivityorServicehas a lifetime dictated by thatActivityorService. Any data that should remain after theActivityorServiceis destroyed should be stored in a file (e.g., database).