![](/img/trans.png)
[英]how to disable status bar or notification bar but not disable title bar in android?
[英]Disable the android notification bar
我只想知道如何在不使我的活动全屏显示的情况下禁用手机中的通知栏?
我正在做一个锁屏,我不希望用户可以拖动通知栏。
将此代码添加到您的AndroidManifest.xml中
android:theme =“ @ android:style / Theme.NoTitleBar”
public static void CancelNotification(Context ctx,int notifyId){字符串ns = Context.NOTIFICATION_SERVICE; NotificationManager nMgr =(NotificationManager)ctx.getSystemService(ns); nMgr.cancel(notifyId); }
这听起来像您所需要的。 它参与创建一个透明窗口,该窗口与状态栏重叠,从而拦截到其的所有触摸事件。
您仍将保留状态栏,用户将无法激活它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.