I am working on a exam related android application. When exam starts i need to lock status bar and notification bar. I used below code but it is only hiding status bar and notification bar.
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//Remove notification bar
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Is any way to lock status bar and notification bar instead of hiding them. For any positive response thanks in advance.
what do you mean locking the notification bar? you mean not receiving any notification for the moment?
regarding your question. What you can do is make your Toolbar not clickable or more specifically make the Navigation Drawer not clickable so the user can not open it.
EDIT:
you can do this:
or look at this posted question: Disable the notification panel from being pulled down