I got this piece of code that creates new TextView, then adds it to ArrayList<View> and when it is finished adding TextViews to Array it sets adds that Array into ListView. But somehow my ListView is appearing empty. Any idea what am I doing wrong?
Here is the code:
ListView lv = (ListView) findViewById(R.id.listView1); ArrayList<View> textvs = new ArrayList<View>(); for (int i=0; i<10;i++) { TextView tv = new TextView(MainActivity.this); tv.setText(""+i); textvs.add(tv); } lv.addTouchables(portit); // lv is my listview