1

通知アイコンがredmi MIデバイスに表示されません。デフォルトのic_launcherと表示され、他のすべてのデバイスイメージに表示されます.API 22およびAndroid 5.1.1 およびminsdk = 15、target =他の多くの携帯電話では問題はありませんが、私のデバイスにはこの問題があります。この問題を解消してください。私のコードは通知アイコンの問題

PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0); 
    NotificationCompat.Builder builder = new NotificationCompat.Builder(this); 
    builder.setSmallIcon(R.drawable.home1); //icon appears in device notification bar and right hand corner of notification 
    builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.home1));   
    builder.setContentIntent(pendingIntent);  
      builder.setContentTitle(Title);   
    builder.setContentText(message);   
    builder.setSubText(subtext); 
    NotificationManager notificationManager = (NotificationManager) getSystemService(context.NOTIFICATION_SERVICE);   
    notificationManager.notify(NOTIFICATION_ID, builder.build()); 

はあなたの通知に2つのアイコンを使用してください事前

+0

hdpi、xhdpiなどのdrawable home1のバージョンが異なりますか? – sJy

+0

ええ、私はまだ画像アイコンが来ていない... –

+0

drawable home1のすべてのバージョンが似ているかどうか確認してください。 – sJy

答えて

0

にありがとうございます。最初のものは小さな白いpngなので、ステータスバーに表示され、もう1つはappロゴです。

差分サイズのある下のフォルダにある白いアイコンを更新します。

  1. hdpi(36x36)
  2. MDPI(24×24)
  3. xhdpi(48×48)

この画像名がapp_logo_white_small.pngされると仮定する。

NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) 
      .setLargeIcon(
        BitmapFactory.decodeResource(
          getResources(), R.drawable.app_icon)) 
      .setSmallIcon(R.drawable.app_logo_white_small) 
      .setContentTitle(mContext.getString(R.string.app_name)) 
      .setDefaults(Notification.DEFAULT_ALL) 
      .setContentText(msg) 
      .setStyle(new NotificationCompat.BigTextStyle().bigText(msg)) 
      .setContentIntent(getPendingIntent()) 
      .setAutoCancel(true); 
    NotificationManager notificationManager = 
      (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); 

notificationManager.notify((int) System.currentTimeMillis(), notificationBuilder.build()); 

お待ちしています。

+0

まだイメージは私のデバイスでは動作しませんが、完璧に靴msgとすべて –

+0

本当ですか、あなた右の小さなアイコンを使用しています。 – Yogendra

+0

あなたはあなたのアイコンや通知画面を共有してもらえますか – Yogendra