简体   繁体   中英

how to disable status bar in android

I am working on message app there i want to disable the status bar it should be shown but not touchable.

i have tried below code: In Activity:

StatusBarManager mStatusBarManager = (StatusBarManager) getSystemService(Context.STATUS_BAR_SERVICE);

mStatusBarManager.disable(StatusBarManager.DISABLE_EXPAND);

In Manifest i have also added the permission :

But i am getting following error:

Caused by: java.lang.SecurityException: StatusBarManagerService: Neither user 10004 nor current process has android.permission.STATUS_BAR.

Resolved! By adding android:sharedUserId="android.uid.system" in Manifest file and LOCAL_CERTIFICATE = platform in Android.mk file

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