How to hide bottom bar via adb shell command programmatically with Android 4.2+

To hide the bottom panel from the tablet, I am trying to run this command with the code

 try
    {

       Process proc = Runtime.getRuntime().exec(new String[]{"su","-c","service call activity 42 s16 com.android.systemui"});
       proc.waitFor();
    }
catch(Exception ex)
    {
        Toast.makeText(getApplicationContext(), ex.getMessage(), Toast.LENGTH_LONG).show();
    }

      

Then it throws an exception

java.io.IOException: An error occurred while executing exec (). Command: [su, -c, service call 42 s16 com.android.systemui] Working directory: null Environment: null

But when I execute a command via adb like "adb shell call service action 42 s16 com.android.systemui" works fine. I mean, he quickly hid the bottom plan. Can anyone help with this issue?

+3
android shell adb


source to share


No one has answered this question yet

Check out similar questions:

934
How do I specify a private SSH key to use when executing a shell command on Git?
843
How can I connect to Android with ADB over TCP?
837
How to hide title bar for Activity in XML with existing custom theme
706
How to display shell commands as they run
416
How to use ADB shell when connecting multiple devices? Error with "error: more than one device and emulator"
355
How do I execute mongo commands through shell scripts?
328
How do I run an app using Android ADB tools?
291
Android ADB device offline, cannot issue commands
6
How to pick up a call from adb
3
Service call names with ADB wrapper (Android SDK)?



All Articles
Loading...
X
Show
Funny
Dev
Pics