Apply changes after android restart [closed]

1

You see, I'm doing an Xposed module and I would like to know what is the way for the changes to be applied after the tlf is restarted.

For example if my module changes the color of the notification bar, I want that after the user chooses the color, I have to restart the tlf so that the changes are applied.

Making changes at runtime causes me several difficulties, what would be the code for that? Is there a function?

    
asked by Manuel Rincon 01.03.2016 в 00:30
source

1 answer

1

First of all, in order to restart the device, you need to have Root permissions to access the phone's commands and generally commercial devices do not have this option active.

Having this simply make a command request.

public static void reiniciarDispositivo()
{
    try 
    {           
       Runtime.getRuntime().exec(new String[]{"/system/bin/su","-c","reboot"});
    } 
    catch (Exception e) {
       Log.d("Error ReiniciarDispositivo: "+ e);
    }
}

This is the most general route however there are two others that are:

Runtime.getRuntime().exec(new String[]{"/system/xbin/su","-c","reboot"});

and

Runtime.getRuntime().exec(new String[]{"su","-c","reboot"});

You can debug the application and check if there is an error in the debug section, since the exception information received by catch is sent there and verify the other two option routes.

    
answered by 01.03.2016 в 04:49