Integer value in TextView

Solution 1:

TextView tv = new TextView(this);
tv.setText(String.valueOf(number));

or

tv.setText(""+number);

Solution 2:

TextView tv = new TextView(this);
tv.setText("" + 4);

Solution 3:

Consider using String#format with proper format specifications (%d or %f) instead.

int value = 10;

textView.setText(String.format("%d",value));

This will handle fraction separator and locale specific digits properly