Hey guys I trying to create a app having a linear layout.and linear layout may have more than one Grid View and it would be generate dynamically.I am trying to do this but it is adding only one grid View not more than one. Any one have answer for this?
private GridView gv[];
.
.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
...
....
gv = new GridView[2];
....
.....
protected void onPostExecute(Boolean result) {
if (al1.length == 2)
linearLayout.setWeightSum(2.0f);
for (int i = 0; i < al1.length; i++) {
gv[i] = new GridView(getApplicationContext());
if (al1.length == 2) {
gv[i].setNumColumns(1);
} else
{
gv[i].setNumColumns(2);
}
gv[i].setAdapter(new gridadapter(getApplicationContext(),
al1[i]));
linearLayout.addView(gv[i]);