In my Activity class I have the following code after setContentView() line.
gridView = (GridView)findViewById(R.id.splitted_grid);
gridView.setAdapter(new SplittedImageAdapter(this, splittedBitmaps));
gridView.setNumColumns((int) Math.sqrt(splittedBitmaps.size()));
System.out.println(gridView.getChildCount()+" childs");
The activity works perfectly and also shows a 3*3 grid with required bitmap images. But the last line shows output as
0 childs
As per the documentation, the getChildCount() method should show the number of childs that means it should show
9 childs
Please help me where I am lacking.
Use
gridView.getCount()method