My application has only one service class (not activity), in which I save the value of one variable, dynamically calculated by one method. Then I need to save this value for further comparison. For instance:
class MyClass extends Service{ static int number1; private void Method(){ int number 2;
I need to compare this variable (number1) with some other variable (number2) that my application computed. This works well, but when the Android OS kills my service and launches this service for a specific purpose (even after rebooting the phone), the value of number1 is lost, and I can not use it for comparison. So how to do this? I was thinking of writing a simple TXT file in which I could save the value of number1 after killing the service,
Is there another way?
source share