I want to add item in the context menu of Power options, appear after long key press of Power. I have tried to capture event onkeyLongpress but its not working.
            Asked
            
        
        
            Active
            
        
            Viewed 1,560 times
        
    -2
            
            
        - 
                    possible duplicate of [How to hook into the Power button in Android?](http://stackoverflow.com/questions/3703071/how-to-hook-into-the-power-button-in-android) – Cheryl Simon Dec 06 '10 at 22:06
 
2 Answers
1
            
            
        Event for power key won't be delivered to other child window, as it is intercepted in PhoneWindowManager.java 
You can add your option in GlobalActions.java
private ArrayList<Action> mItems;
        brightintro
        
- 1,016
 - 1
 - 11
 - 16
 
        Lily Gaun
        
- 11
 - 2
 
0
            
            
        I want to add item in the context menu of Power options
That is not possible except via firmware modifications, AFAIK.
        CommonsWare
        
- 986,068
 - 189
 - 2,389
 - 2,491
 
- 
                    I want to know what is the reason. Its also a key. So why we cannot capture key event or context menu? Please give me relative detail. – Ahmed Abdullah Saeed Dec 07 '10 at 19:56