What I want is to create multiple view in for loop example
for(int i =1; i<5; i++){
GridView view = new Gridview(this);
}
But It creates 5 gridview with the same name.. so in future i can't set different option to a specific gridview. How do I get, that gridivew created in a loop get view + i name
Use a List
List<GridView> views = new ArrayList<GridView>();
for(int i = 1; i < 5; i++) {
views.add(new GridView(this));
}
Then you can get your views with
views.get(i);
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments