-2

i am trying to get a textView id from a value from an array

I tried to use this without success:

String string1 = String.valueOf(token[1]);
token[0].settext(string1)

How do I dynamically reference a textview using an Id stored into an array?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
  • Look at this https://stackoverflow.com/questions/8937380/how-to-set-id-of-dynamic-created-layout – Tara Nov 23 '17 at 07:23
  • no need to convert the id to String. Assuming `token` is an int array, do `((TextView)findViewById(token[0])).setText(string1);` – Droidman Nov 23 '17 at 15:41

1 Answers1

0

You can use this to get text

String string1 = token[1].getText().toString(); token[0].setText(string1);

Omkar Shinde
  • 121
  • 1
  • 5