-1

I 'm starting with Xposed module and gives me an error I do not understand .

Use a ColorPicker to choose a color and then use the module, colorPicker works perfect

I then apply the code

if I put the color in the code,Color.Black works...

   @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity);
        btn = (Button) findViewById(R.id.ybutton);
        btn.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                colorPickerDialog = new ColorPickerDialog(Ver.this, color);
                colorPickerDialog.setAlphaSliderVisible(true);
                colorPickerDialog.setHexValueEnabled(true);
                colorPickerDialog.setTitle("Color Bar");
                colorPickerDialog.setOnColorChangedListener(new ColorPickerDialog.OnColorChangedListener() {

                @Override
                public void onColorChanged(int i) {
                        color = i;
                        //change the color of the button to confirm it works
                        btn.setBackgroundColor(color);
                    }
                });
                colorPickerDialog.show();
            }
        });
    }

    public void handleInitPackageResources(final XC_InitPackageResources.InitPackageResourcesParam resparam) throws Throwable {
        if (!resparam.packageName.equals("com.run.appBar"))
            return;
        XposedBridge.log("Conexion hecha");

        resparam.res.setReplacement("com.run.appBar", "color", "color_primary", color);//appBar
        XposedBridge.log("color cambiado");
    }
Sufian
  • 6,405
  • 16
  • 66
  • 120

1 Answers1

-1

You can't use an Activity in an Xposed module.
I was able to the behavior I was trying to do by creating a service and sending messages between my interface and my hook through the service.