It is necessary to turn off the device correctly (shut down the android). There are two ways that are described everywhere, but they are not suitable.

  1. Intent i = new Intent("android.intent.action.ACTION_REQUEST_SHUTDOWN"); i.putExtra("android.intent.extra.KEY_CONFIRM", true); startActivity(i);

    This option does not suit, because system language (locale) is used in the pop-up dialog. And I need to use the program language (there is no access to the system settings).


  1. PowerManager powerManager = (PowerManager)getSystemService(Context.POWER_SERVICE); powerManager.reboot(null); This option is also not quite suitable, because This causes a reboot and not a shutdown.

Based on this, the question is: Is it possible to change the language of the activity labels that I call through the intent without using the system settings? How to shut down the OS using the PowerManager class?

  • And what is the language of activity - explain in more detail - Barmaley
  • I mean Russian, English, etc. The language in which the dialog box labels are displayed. - selya

0