NotificationCompat android - how to show only Large icon without small

后端 未结 5 1835
轻奢々
轻奢々 2021-01-04 10:59

When I add notification:

        NotificationCompat.Builder mBuilder =
                            new NotificationCompat.Builder(this)  
              .set         


        
5条回答
  •  猫巷女王i
    2021-01-04 11:35

    Based on the previous answer you can also hide the expended view too :

    int smallIconId = AnghamiApp.getContext().getResources().getIdentifier("right_icon", "id", android.R.class.getPackage().getName());
                if (smallIconId != 0) {
                    notification.contentView.setViewVisibility(smallIconId, View.INVISIBLE);
                    notification.bigContentView.setViewVisibility(smallIconId, View.INVISIBLE);
                }
    

提交回复
热议问题