viernes, 9 de noviembre de 2012

How to convert int to string




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);
ed.setText(String.valueOf(x));
ed.setText(Integer.toString(x));

Source: StackOverflow

No hay comentarios:

Publicar un comentario