Commit d3cdd711 by Sebastián Katzer

App throwed an error at restart if a callback was registered

parent 448b220d
......@@ -47,7 +47,9 @@ More informations can be found [here](https://build.phonegap.com/plugins/413).
## Release Notes
#### Version 0.7.1 (not yet released)
- [bugfix:] `ongoing` attribute was ignored.
- [bugfix:] `oncancel` wasnt fired if `autoCancel` was set to true.
- [bugfix:] App throwed an error at restart if a callback was registered.
#### Version 0.7.0 (22.01.2014)
**Note:** The new way of callback registration will be not compatible with previous versions! See #62
......
......@@ -275,7 +275,11 @@ public class LocalNotification extends CordovaPlugin {
* Gibt an, ob die App im Hintergrund läuft.
*/
private static boolean isInBackground () {
try {
return !context.getPackageName().equalsIgnoreCase(((ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE)).getRunningTasks(1).get(0).topActivity.getPackageName());
} catch (Exception e) {
return true;
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment