Commit e6c02a73 authored by Libin Lu's avatar Libin Lu Committed by GitHub

support drawable notif icon

parent 30ce05f5
...@@ -96,7 +96,12 @@ public class SendNotificationTask extends AsyncTask<Void, Void, Void> { ...@@ -96,7 +96,12 @@ public class SendNotificationTask extends AsyncTask<Void, Void, Void> {
//icon //icon
String smallIcon = bundle.getString("icon", "ic_launcher"); String smallIcon = bundle.getString("icon", "ic_launcher");
int smallIconResId = res.getIdentifier(smallIcon, "mipmap", packageName); int smallIconResId = res.getIdentifier(smallIcon, "mipmap", packageName);
if(smallIconResId == 0){
smallIconResId = res.getIdentifier(smallIcon, "drawable", packageName);
}
if(smallIconResId != 0){
notification.setSmallIcon(smallIconResId); notification.setSmallIcon(smallIconResId);
}
//large icon //large icon
String largeIcon = bundle.getString("large_icon"); String largeIcon = bundle.getString("large_icon");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment