待处理操作 - 触摸时展开通知

时间:2017-03-01 09:09:41

标签: android notifications expand

我使用setCustomBigContentView进行通知(从xml加载样式):

    mBuilder = new NotificationCompat.Builder(this);
    mBuilder.setShowWhen(false);
    mBuilder.setDefaults(Notification.DEFAULT_ALL);
    mBuilder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
    mBuilder.setSmallIcon(R.drawable.play_btn_2x);
    mBuilder.setContentText("no in use this");
    mBuilder.setLargeIcon(icon);
    mBuilder.setPriority(Notification.PRIORITY_MAX);
    mBuilder.setContent(contentNotifySmall); 
    //mBuilder.setAutoCancel(false);
    mBuilder.setCustomBigContentView(contentNotify);

当某些电话具有系统优先级应用程序(反病毒或任务清理程序)时,无法进行自我扩展(通知需要在顶部)。还行吧 。但只有扩展通知的方法是两个手指滚动,长触摸向下滚动,点击 - 第二个动作向下滚动。

每个有待处理操作的示例都是打开活动的人。

我需要采取行动,如何在简单触摸事件上从小视图扩展到大视图通知。

0 个答案:

没有答案