package com.coderzheaven.testlistview;

import java.util.ArrayList;

import android.app.Activity;
import android.os.Bundle;
import android.widget.GridView;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);

		ArrayList<String> items = new ArrayList<String>();

		// adding 100 images
		for (int p = 0; p < 100; p++) {
			items.add("photo");
		}

		ListAdapter list = new ListAdapter(this, items);

		GridView grid = new GridView(this);

		grid.setAdapter(list);

		grid.setNumColumns(GridView.AUTO_FIT);

		setContentView(grid);

	}

}
