通知栏中的addAction按钮不会出现

时间:2014-06-23 08:41:51

标签: android notifications

我有这个代码

    Notification n  = new Notification.Builder(this)
        .setTicker("here is a text")
    .setContentTitle("Title")
        .setContentText ("Alot of text"))
        .setSmallIcon(R.drawable.icon_notif)
        .setContentIntent(sender)           
        .setAutoCancel(true)
        .addAction(R.drawable.btn_media_play, "Play", PlaypendingIntent)
        .addAction(R.drawable.btn_media_pause, "Pause", PausependingIntent)
        .build();      

        n.icon = R.drawable.ic_stat;

        notificationManager.notify(1, n);

但是在通知栏中(当我在backgorund中发送应用程序时)它没有显示下面的按钮播放和暂停,任何人都有一个想法为什么?

1 个答案:

答案 0 :(得分:0)

我已经在星系2和星系3上测试了我的应用程序,它显示了按钮,但我的主要问题是:

  • 首先,我必须从计算机上拔下usb线,然后再次运行应用程序才能看到按钮

  • 在第二个星系标签3 lite 7.0(我认为它是标签)就像@Sundeep所说的那样,但是 你必须在通知栏上用手指等待1/2 秒,然后向下滑动以显示添加的按钮

相关问题