Added customisable notification icon for Android

This commit is contained in:
Gearóid Moroney
2015-06-04 10:59:11 +01:00
parent 04d5dc581b
commit cd1fb46dcc
3 changed files with 7 additions and 5 deletions

View File

@@ -205,12 +205,12 @@ public class ForegroundService extends Service {
* The resource ID of the app icon
*/
private int getIconResId() {
JSONObject settings = BackgroundMode.getSettings();
Context context = getApplicationContext();
Resources res = context.getResources();
String pkgName = context.getPackageName();
int resId;
resId = res.getIdentifier("icon", "drawable", pkgName);
int resId = res.getIdentifier(settings.optString("icon", "icon"), "drawable", pkgName);
return resId;
}