我正在使用吐司消息;吐司消息显示远低于棉花糖6.0,但对于棉花糖6.0和6。+吐司不显示,推送通知也不显示。请解决这个问题。
敬酒:
Toast.makeText(context, "You can use this service once between every 8 hours", Toast.LENGTH_LONG).show();
对于推送通知:
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context);
mBuilder.setSmallIcon(R.drawable.ic_warning_24dp).setContentTitle("Friends in danger").setContentText("Save friends in danger.");
//Intent resultIntent=new Intent(context,DangerFriendsMapsActivity.class);
TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(context);
taskStackBuilder.addParentStack(DangerFriendsMapsActivity.class);
taskStackBuilder.addNextIntent(toDangerIntent);
PendingIntent pendingIntent = taskStackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(pendingIntent);
Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);
mBuilder.setSound(alarmSound);
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0, mBuilder.build());
最佳答案
我自己解决了我的问题,去吧
来自移动设置的声音和通知。接下来,滚动到要调整通知设置的应用。
启用它