2016-05-05 77 views
1

我使用NotificationCompat來顯示來電,但問題是時間限制較少,我想顯示NotificationCompat 40秒,是否有任何方法來增加顯示通知的時間,因爲當前時間顯示通知少於40秒如何增加NotificationCompat的時間顯示

Intent dismissIntent = new Intent(); 
    PendingIntent piDismiss = PendingIntent.getService(ctx, 0,dismissIntent, 0); 
    Intent callIntent = new Intent(); 
    PendingIntent pendingcall = PendingIntent.getService(ctx, 0, callIntent, 0); 

    NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx).setSmallIcon(R.drawable.ic_launcher) 
      .setContentTitle("Ping Notification").setContentText("Tomorrow will be your birthday.") 
      .setDefaults(Notification.DEFAULT_ALL).setPriority(NotificationCompat.PRIORITY_HIGH) 
      .addAction(R.drawable.call_end, "Dismiss", piDismiss) 
      .addAction(R.drawable.call_accept, "Accept", pendingcall); 

    NotificationManager notificationManager = (NotificationManager) ctx 
      .getSystemService(Context.NOTIFICATION_SERVICE); 
    notificationManager.notify(0, builder.build()); 

感謝

回答

2

單挑通知能見度長度設置在操作系統和不能改變

+0

感謝更新 – Munir

+0

可能會在未來的好運氣那 – Munir