How to add a button into notification?

前端 未结 2 835
你的背包
你的背包 2020-12-18 17:06

I do it like this:

RemoteViews views = new RemoteViews(..);
views.setOnClickPendingIntent(R.id.button1,pd);
noti.contentviews = views;

and

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-18 18:10

    You cannot put interactive widgets, like a Button, in a Notification and get user input from them. These are for output display only.

提交回复
热议问题