How to use a button to simulate the physical power button like, a button press would open the power menu like this one Power menu Image
            Asked
            
        
        
            Active
            
        
            Viewed 128 times
        
    0
            
            
        - 
                    I think this will answer your question: https://stackoverflow.com/questions/14352648/how-to-lock-unlock-screen-programmatically – Khalid Taha Jul 10 '21 at 17:31
 - 
                    Does this answer your question? [How to Lock/Unlock screen programmatically?](https://stackoverflow.com/questions/14352648/how-to-lock-unlock-screen-programmatically) – Khalid Taha Jul 10 '21 at 17:31
 - 
                    Try this one - [How to show power off menu on android on the click of a button?](https://stackoverflow.com/questions/40614913/how-to-show-power-off-menu-on-android-on-the-click-of-a-button). Is that whay you want ? – AShX Jul 10 '21 at 17:32