I'm trying to modify or override the functionality of power off menu button in android (not the button to screen on / off).
I want to fired a process before the device shutdown, run a process and after that shutdown the device
If this it's possible?
I'm trying to modify or override the functionality of power off menu button in android (not the button to screen on / off).
I want to fired a process before the device shutdown, run a process and after that shutdown the device
If this it's possible?
Simple answer: No.
This is not possible, without custom modification to your firmware or the core of the Android operating system, for a limited number of devices. More info
So on a rooted device, you might be able to do that. Check this link.
Yes it is possible.You don't have to have a rooted device just use a broadcast. In manifest:
<receiver android:name="com.example.broadcastreceiver.YourClass">
    <intent-filter>
        <action android:name="android.intent.action.ACTION_SHUTDOWN" />
    </intent-filter>
</receiver>
YourClass:
public class YourClass extends BroadcastReceiver {
    @Override
    public void onReceive(Context c, Intent i) {
          if(i.getAction().equals("android.intent.action.ACTION_SHUTDOWN")){
                     //Fire your code here      
          }
    }};
}
If it sounds impossible,Find another way to do the same thing ;)