How to add a Dynamic image instead of notification icon in android?

前端 未结 2 2002
刺人心
刺人心 2021-01-19 23:01

I used below code for displaying notification in notification Bar.

it worked fine.

But i need to display notification icon dynamically that will come from w

2条回答
  •  别那么骄傲
    2021-01-19 23:41

    just add some icons in your resource folder and then

    int myIcon = R.drawable.image;

    your logic goes here ....

    and change value of icon according to your logic like myIcon = R.drawable.somenewimage;

    and then finally set your notification

    Notification note = new Notification(myIcon,"status message", System.currentTimeMillis());

提交回复
热议问题