Problem:
I need to convert an integer value into a string.
Solution:
Use
+
, the string concatenation operator:ed = (EditText) findViewById (R.id.box);
int x = 10;
ed.setText(""+x);
or use
String.valueOf(int)
:ed.setText(String.valueOf(x));
or use
Integer.toString(int)
:ed.setText(Integer.toString(x));
Source: StackOverflow
No hay comentarios:
Publicar un comentario