Click here to Skip to main content
15,886,362 members

Comments by Faraz Azhar, Dubai (Top 2 by date)

Faraz Azhar, Dubai 2-Mar-12 12:07pm View    
Thanks!
Faraz Azhar, Dubai 21-Jun-11 10:53am View    
Yes the app is shutting down properly. I just read something on the net after hours of searching ... someone says that OnReceive event of the AppWidgetProvider is just a ghostly instance, it is initiated by a Broadcast. It is not linked with the rest of the class. So if the OnReceive is using any of variables from the class and tries to change it, the changes wont save in it. To save changes, one must use SharedPreferences or file or database to store values.

Is that true ? Kinda weird to believe. But is somewhat true seeing what's happening. If I set my variable to "5" at declaration (e.g. private int myNum = 5), and add 1 to it in OnReceive; the Toast displays 6. But it keeps displaying 6 everytime. Seems like the addition of 1 to variable is not being saved in memory. Very weird. Any clues on that ?