this way to switch the type is ok

textview.setText(String.valueOf(val));