How to open font size options directly from intention?

I would like the user to be able to edit the font and font style from my application. The application should simply call up the default settings.

enter image description here Example:

 displayBtn = (Button) findViewById(R.id.displayBtn);
    displayBtn .setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            startActivity(new Intent(Settings.ACTION_DISPLAY_SETTINGS));
        }
    });
+4
source share
1 answer

XML is not edited at run time, so you may need to set a static value for the font size, and then manually set them to applicaiton.

For instance..

public static int defaultFontSize = defaultValue;

//Update the value when the user changes font..
ClassName (class where you declared the static variable).defaultFontSize = 10;

textView.setTextSize(ClassName.defaultFontSize);
+1
source

All Articles