I have been trying to restart SytemUI using these in my app,but it is not working,am on Android 4.0.4.Any help?
am startservice -n com.android.systemui/.SystemUIService
It works in adb shell,but not in my app or in terminal on android.
Code I am using in my app:
Process mSuProcess; mSuProcess = Runtime.getRuntime().exec("su");
DataOutputStream mSuDataOutputStream = new DataOutputStream(mSuProcess.getOutputStream());
mSuDataOutputStream.writeBytes("am startservice -n com.android.systemui/.SystemUIService\n");
After a lot of searching on the internet, I managed to get the System Bar to appear in a 4.2 device using:
am startservice --user 0 -n com.android.systemui/.SystemUIService
Alternatively some people have used the -a (instead of -n) option, though this was causing a error or my device:
Error: Not found; no service started.
Run shell instead of su, like;
Process mSuProcess; mSuProcess = Runtime.getRuntime().exec("sh");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With