Question: I have 2 buttons for increasing and decreasing `TextView` font size:

```
    btnZoomin.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
           txtview.setTextSize(txtview.getTextSize()+1);
        }
    });
    btnZoomout.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            txtview.setTextSize(txtview.getTextSize()-1);
        }
    });

```

But are experiencing difficulty, as it will not work.

Answer: 
txtview.setTextSize(TypedValue.COMPLEX\_UNIT\_PX,txtview.getTextSize()-1);
txtview.setTextSize(TypedValue.COMPLEX\_UNIT\_PX,txtview.getTextSize()+1);
Use this `text.setTextSize(TypedValue.COMPLEX_UNIT_SP,14);`