I have created a TextView
in android like the code below:
txtv = new TextView(this);
txtv.setText("text");
ll.addView(txtv);
Same way I have created a spinner
:
spinner = new Spinner(this);
ll.addView(spinner);
But I am unable to populate value on the spinner
. Most tutorials giving populating spinner
with ArrayAdapter
but it is taking id
of xml
, like R.id....
. Since I am creating dynamic, I can't do like that way. How can I populate spinner
dynamically?