1

Is any method which i can call and it return to me information that phone actual going to shutdown (power off). I know that is intent ACTION_SHUTDOWN but I have to get information about shutting down the phone form anther source. The best is directly form system. Maybe checking of same files in /proc or in /sys fs.

Nithin Michael
  • 2,166
  • 11
  • 32
  • 56
LunaVulpo
  • 3,043
  • 5
  • 30
  • 58

1 Answers1

1

Use BraodcastReceiver, extend it and override onReceive.

public class Receiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        // Your code goes here
    }
}

When you want to use it:

activity.registerReceiver(receiver, shutDownIntent);
dragostis
  • 2,574
  • 2
  • 20
  • 39