I want to restart android device using code in Xamarin. I have read many threads and found one with the following code:
try
{
PowerManager pm = (PowerManager)GetSystemService(Context.PowerService);
pm.Reboot(null);
}
catch (Exception ex)
{
}
and I modified my Manifest file like below, to get System level access:
<uses-permission android:name="android.permission.REBOOT" />
<application android:sharedUserId="android.uid.system" android:label="Appname" android:icon="@drawable/Icon"></application>
But I am getting the following exception in the result:
Java.Lang.SecurityException: Neither user 10523 nor current process has android.permission.REBOOT.