Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to switch off the mobile with code


C#
 try {
  String[] str ={"su","-c","reboot -p"};
  Process p = Runtime.getRuntime().exec(str);
      } catch (Exception e) {
        Log.v("Exception is ", e.toString());
}


I am using this code but getting IOExecption

Thanks in Advance
Posted
Updated 9-Apr-13 3:45am
v2
Comments
Sandeep Mewara 9-Apr-13 13:52pm    
It would help you if you share the full exception detail.

1 solution

It is not possible to switch off your mobile unless you have the manufacturer key to sign your app/or if your device is rooted. Check this [LINK]for more information.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900