Fix for showing badges on Samsung.
Sorry, I did it in online github editor and forgot to copy paste all needed code :)
This commit is contained in:
parent
168bf0d404
commit
a1109fc303
|
|
@ -30,11 +30,11 @@ public class SamsungHomeBadger extends ShortcutBadger {
|
|||
if (cursor != null) {
|
||||
while (cursor.moveToNext()) {
|
||||
int id = cursor.getInt(0);
|
||||
ContentValues contentValues = getContentValues(badgeCount);
|
||||
ContentValues contentValues = getContentValues(badgeCount, false);
|
||||
contentResolver.update(mUri, contentValues, "_id=?", new String[]{String.valueOf(id)});
|
||||
}
|
||||
} else {
|
||||
ContentValues contentValues = getContentValues(badgeCount);
|
||||
ContentValues contentValues = getContentValues(badgeCount, true);
|
||||
contentResolver.insert(mUri, contentValues);
|
||||
}
|
||||
} finally {
|
||||
|
|
@ -42,7 +42,7 @@ public class SamsungHomeBadger extends ShortcutBadger {
|
|||
}
|
||||
}
|
||||
|
||||
private ContentValues getContentValues(int badgeCount) {
|
||||
private ContentValues getContentValues(int badgeCount, boolean isInsert) {
|
||||
ContentValues contentValues = new ContentValues();
|
||||
if (isInsert) {
|
||||
contentValues.put("package", getContextPackageName());
|
||||
|
|
|
|||
Loading…
Reference in New Issue