Hi team i created flutter project and my task is if i press the restart button mobile device need to got restarted but if i press the button it wont works got error in console
error -> either user 10478 nor current process has android.permission.REBOOT
android code for restart
private void restart() {
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
pm.reboot(null);
}
I have added the permission in androidmanifest too, but no luck.
do I need to restart my device?