At the beginning Activity is launched by an Intent and something is done with this Intent.
When I change orientation of my Activity, it\'s reloaded again and Intent is
If you set the intent action, you can clear it with getIntent().setAction("");
For example in onCreate(...)
:
...
String action = getIntent().getAction();
if (action != null) {
if (action.equals(YOUR_ACTION_WHATEVER)) {
doSomethingHere(); // do something here
getIntent().setAction(""); // clear the action
}
}
...
This will clear the action, otherwise it will be called every time you rotate the device.