The Screen Pinning feature on the Android 5 lets you freeze the screen on a specific view. To Pin screen on HTC One M8 and restrict the other's access, do as follows:
1. Tap the Recent Apps button (Right to the Home button)
2. Tap the 3dot icon, and go to the Settings.
3. Go to the Screen Pinning settings and make sure the feature is enabled
4. Now, open the application or screen you want to pin
5. Tap the Recent Apps button again, and there you should see the pin icon
6. Simply tap the Pin icon and the screen is pinned