I want to programmatically set the dimensions of TextView. But I'm using sdp and ssp values. How can I use these values to set the dimensions of a textview programatically.
TextView tasks = new TextView(this);
tasks.setText(name);
tasks.setTextSize(??);
tasks.setMargin(??)
ViewGroup.LayoutParams l1 = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, height??); // what is the height input here?
And how to set the text size (ssp) and margin/padding (sdp)?