简体   繁体   中英

Disable the android notification bar

i just want to know how can i disable the notification bar in my mobile without making my activity fullscreen?

Im doing kind of a lockscreen and i dont want the user can drag down the notification bar.

add this code in to your AndroidManifest.xml

android:theme="@android:style/Theme.NoTitleBar"

public static void CancelNotification(Context ctx, int notifyId) { String ns = Context.NOTIFICATION_SERVICE; NotificationManager nMgr = (NotificationManager) ctx.getSystemService(ns); nMgr.cancel(notifyId); }

This sounds like what you need. It invovles creating a transparent window overlapping the status bar and thereby intercepting all touch events to it.

You'll still keep the status bar, the user just won't be able to activate it.

https://stackoverflow.com/a/7630993/455886

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM