-4

I'm new in Android and I want to get an integer value to String variable to set that value to TextView

Dharmendra
  • 33,296
  • 22
  • 86
  • 129
Ankitkumar Makwana
  • 3,475
  • 3
  • 19
  • 45

3 Answers3

0
int i = 12;
String str = String.valueOf(i); // one option
str = "" + i; // two options
Integer num = i;
str = num.toString();

You should always try to find the answer yourself before posting here.

Boris Strandjev
  • 46,145
  • 15
  • 108
  • 135
0

Try the following code:-

(integerValue).toString()
0xC0DED00D
  • 19,522
  • 20
  • 117
  • 184
Pratik Patel
  • 474
  • 4
  • 20
0

I think you should use this.

String str = Integer.toString(integer_variable);
Pang
  • 9,564
  • 146
  • 81
  • 122
Never Quit
  • 2,072
  • 1
  • 21
  • 44