[在Android中未打开应用时如何显示全屏通知? [关闭]

问题描述 投票:0回答:1
我想创建一个警报应用程序。我想在警报响起时显示活动。如何实现?
android alarm android-alarms background-service
1个回答
0
投票
您必须启动设置FullScreenIntent的通知,如下所示:

NotificationCompat.Builder builder = new NotificationCompat.Builder(this); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); builder.setFullScreenIntent(pendingIntent, true);

© www.soinside.com 2019 - 2024. All rights reserved.