2
通知バーに画像を表示しようとしています。しかし、私はJPG形式の画像を設定する私のアプリケーションはアンドロイドがプロセスを停止して閉じた。そして、PNGアイコンを設定するとアイコンが表示されません。私は両方のタイプのアイコンのサイズを32dpに変更し、24dpのサイズも試します。 HERESに私のコードとスクリーンショット - 問題のAndroid通知にタイトル画像JPGまたはPNG形式が表示されない
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);
}
あなたはどのAndroidバージョンを使用しましたか? – USKMobility
API 22、Lollipopバージョン。 – Istiyak
@Istiyakあなたは解決策を得ましたか? – Pallavi