Skip to content

Commit

Permalink
support drawable notif icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Libin Lu authored Sep 28, 2017
1 parent 30ce05f commit e6c02a7
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ protected Void doInBackground(Void... params) {
//icon
String smallIcon = bundle.getString("icon", "ic_launcher");
int smallIconResId = res.getIdentifier(smallIcon, "mipmap", packageName);
notification.setSmallIcon(smallIconResId);
if(smallIconResId == 0){
smallIconResId = res.getIdentifier(smallIcon, "drawable", packageName);
}
if(smallIconResId != 0){
notification.setSmallIcon(smallIconResId);
}

//large icon
String largeIcon = bundle.getString("large_icon");
Expand Down

0 comments on commit e6c02a7

Please sign in to comment.