I am using Linage 16 and there I have got enable navbar setting. I want to enable navbar using Tasker program. I have read some info here: Enable On-screen navigation in CM12 (Lollipop) using shell? . But I still don't understand how to make it.

  • I need to enable/disable navbar using shell, java etc. Editing build.prop is not suitable for me Oct 7 '18 at 18:35
  • Welcome to Android Enthusiasts! It would help if you could edit your question and include where you are stuck. What is it you didn't understand? Have you Tasker installed, and established task and condition? Does it not work? Did you try it from the command line, e.g. via adb shell "settings put secure dev_force_show_navbar 1"?
    – Izzy
    Oct 7 '18 at 18:37
  • Yes, I have tried, it doesn't work. There is another method in the link I have given, but I don't understand what to do Oct 8 '18 at 2:30
  • If it doesn't work from adb shell it's unlikely the same command works from Tasker (if you referred to something other, please be more specific). What I could imagine (being with Android since v2.x) is that the Google devs again thought that's something a normal user should'nt be able to. Is your device rooted? Then you could try the same command after having executed su for super-user powers.
    – Izzy
    Oct 8 '18 at 4:30
  • My device is roote., I have tried command from shell(I have typed command "su" before) and tasker, nothing is working Oct 8 '18 at 5:22

This is interesting haven't tested this thoroughly but you can try this;

Tasker now has WRITE_SECURE_SETTINGS permission to the Manifest. Hence it is now easier to control device Secure/Global settings without needing an additional plug-in such as AutoTools or SecureTask.

You can enable this new permission by issuing the following command via ADB (important):

adb shell pm grant net.dinglisch.android.taskerm android.permission.WRITE_SECURE_SETTINGS

Now the business end you, since you want to use the Java function proceed as follows:

We need to call,

cr = CONTEXT.getContentResolver();
Settings.Secure.DEV_FORCE_SHOW_NAVBAR, 1);)

As usual create a task to this this, name it accordingly.

The following actions are found under Code → Java function

A1: Java Function [ Return:cr Class Or Object:CONTEXT Function:getContentResolver {ContentResolver} ()

A2: Java Function [ Class Or Object:Secure Function:putInt{boolean} (ContentResolver, String, int) Param(ContentResolver): cr Param(string):dev_force_show_navbar Param:(int):1

Save and execute task to test

However I would have preferred a simpler route with run shell (Tasker) or adb:

A1: Code Run shell [Command: settings put secure dev_force_show_navbar 1 Tick Use root]


adb shell settings put secure dev_force_show_navbar 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.