I read this somewhere here and I totally lost it, but could use some assistance.
My app is pulling the column names from sqlite into an array. I want to create a tex
For me this is a solution.
// Set Variables
TextView t;
ArrayList textViewArrayList;
LayoutInflater layoutInflater;
LinearLayout ll_itensobrigatorios
// Tell in your onCreate
layoutInflater = getLayoutInflater();
createViewItem(new String[]{"Fabio", "Santos", "Programador", "Natal"});
// This create view in layout
private void createViewItem(String[] nomes) {
textViewArrayList = new ArrayList<>();
for(int i = 0; i < nomes.length; i++) {
View vll = layoutInflater.inflate(R.layout.nomes_tec_item, ll_itensobrigatorios, false);
t = (TextView) vll.findViewById(R.id.txt_tec_item);
textViewArrayList.add(t);
ll_itensobrigatorios.addView(vll);
}
for(int i = 0; i < textViewArrayList.size(); i++) {
textViewArrayList.get(i).setText((i + 1) + " - " + nomes[i]);
}
}