如何更改自定义通知栏按钮的背景

时间:2015-07-23 05:58:11

标签: android notifications imageview

如何更改通知栏按钮的背景图像,我想在一个按钮上播放/暂停,但我无法更改背景图像。

public static void setListeners(RemoteViews view, Context context) {
    // Intent pause = new Intent(NOTIFY_PAUSE);
    Intent play = new Intent(context, NotificationBroadcast.class);

    PendingIntent pPlay = PendingIntent.getBroadcast(context, 0, play,
            PendingIntent.FLAG_UPDATE_CURRENT);
    view.setImageViewResource(R.id.buttonplay, R.drawable.play_button);
    view.setOnClickPendingIntent(R.id.buttonplay, pPlay);

}

0 个答案:

没有答案