Android notification update now updates inline

This commit is contained in:
Gearóid Moroney
2015-06-03 19:45:26 +01:00
parent cec56db33c
commit 04d5dc581b
2 changed files with 32 additions and 6 deletions

View File

@@ -59,12 +59,15 @@ public class BackgroundMode extends CordovaPlugin {
// Tmp config settings for the notification
private static JSONObject updateSettings;
ForegroundService mService;
// Used to (un)bind the service to with the activity
private final ServiceConnection connection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder binder) {
// Nothing to do here
public void onServiceConnected(ComponentName name, IBinder service) {
ForegroundService.ForegroundBinder binder = (ForegroundService.ForegroundBinder) service;
mService = binder.getService();
}
@Override
@@ -216,8 +219,7 @@ public class BackgroundMode extends CordovaPlugin {
*/
private void updateNotifcation() {
if (isBind) {
stopService();
startService();
mService.updateNotification();
}
}