Search code examples
android-appwidget

How long does an Instance of my appWidget exist


My simple Question:

How long does an instance of an appwidget exist?

To be more precise.

If I declare a static variable in an appwidget:

public static int myInt = 5;

Is it all the time accessable from my other activities which only launch if I click on the button?

Or does it just exist at an update which is defined in xml or if I click on the appwidget till the code has been finished.


Solution

  • Static variable exists as long as your process alive.