Ich versuche, ein Bild in der Benachrichtigungsleiste anzuzeigen. Aber wenn ich Bild, das JPG-Format ist Meine Anwendung geschlossen mit Android gestoppt Prozess. Und wenn ich ein PNG-Symbol einstelle, wird das Symbol dort nicht angezeigt. Ich ändere die Größe meines Symbols 32dp und versuche auch 24dp. Heres mein Code und Screenshot -Android-Benachrichtigung zeigt Titelbild JPG- oder PNG-Format nicht an
public void shownotification(View view){
Intent intent = new Intent();
PendingIntent pendingIntent = PendingIntent.getActivity(MainActivity.this,0,intent,0);
Notification notification = new Notification.Builder(MainActivity.this)
.setTicker("Tittle")
.setContentTitle("Content Tittle")
.setContentText("All details of Content")
.setSmallIcon(R.drawable.cdc)
.setContentIntent(pendingIntent).getNotification();
notification.flags = Notification.FLAG_AUTO_CANCEL;
NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
notificationManager.notify(0,notification);
}
Welche Android-Version hast du benutzt? – USKMobility
API 22, Lollipop Version. – Istiyak
@Istiyak hast du irgendeine Lösung bekommen? – Pallavi