2014-10-29 103 views
2

我想爲setGroup()的組分配一個通知,用於堆疊通知並進行彙總。無法解析方法setGroup

HERE

final static String GROUP_KEY_SAPPHIRE = "group_key_emails"; 
NotificationCompat.Builder oneBuilder = new NotificationCompat.Builder(this); 

     oneBuilder.setSmallIcon(R.drawable.warning_icon) 
     .setContentTitle("Warning: ") 
     .setContentText(message) 
     .setPriority(0x00000002) 
     .setLights(Color.GREEN, 500, 500) 
     .setGroup(GROUP_KEY_SAPPHIRE) 

     .addAction (R.drawable.ic_action_accept_dark, 
      getString(R.string.ok), warningPendingIntent); 

    NotificationManager oneNotificationManager = 
      (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); 

    oneNotificationManager.notify(NOTIFICATION_ID, oneBuilder.build()); 
    editText.setText(""); 

但我總是得到的迴應,該方法個setgroup無法解析。 我輸入了.v4.support庫

在此先感謝

回答

1

這可能爲時已晚,但其他人有問題,像我這樣的,你應該更新.v4.support庫。至少在Gradle build.gradle應用程序依賴項中支持-v4:21,這種堆疊樣式可以從API 21+獲得。