Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
Set application icon in new thread
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh committed Mar 15, 2016
1 parent 764c4b9 commit 5a604c9
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/android/com/adobe/phonegap/push/PushPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,17 @@ public void run() {
}
});
} else if (SET_APPLICATION_ICON_BADGE_NUMBER.equals(action)) {
Log.v(LOG_TAG, "setApplicationIconBadgeNumber: data=" + data.toString());
try {
setApplicationIconBadgeNumber(getApplicationContext(), data.getJSONObject(0).getInt(BADGE));
} catch (JSONException e) {
callbackContext.error(e.getMessage());
}
callbackContext.success();
cordova.getThreadPool().execute(new Runnable() {
public void run() {
Log.v(LOG_TAG, "setApplicationIconBadgeNumber: data=" + data.toString());
try {
setApplicationIconBadgeNumber(getApplicationContext(), data.getJSONObject(0).getInt(BADGE));
} catch (JSONException e) {
callbackContext.error(e.getMessage());
}
callbackContext.success();
}
});
} else {
Log.e(LOG_TAG, "Invalid action : " + action);
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.INVALID_ACTION));
Expand Down

0 comments on commit 5a604c9

Please sign in to comment.