I have created a Text View in android like the code below:
LinearLayout ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);
sv.addView(ll);
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 array adapter but it is taking id of xml, like R.id. .... Since I am creating dynamic I cant do like that way. How can I populate spinner dynamically?