package cis470.gridview.images;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;
import android.widget.TextView;

public class ArrayAdapter3BImages extends Activity {
	TextView txtMsg;
	GridView grid;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		txtMsg = (TextView) findViewById(R.id.txtMsg);

		grid = (GridView) findViewById(R.id.gridView1);
		
		grid.setAdapter(new ImageAdapter(this));
		
		grid.setOnItemClickListener(new OnItemClickListener() {
	        public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
	            txtMsg.setText("Image selected:  " + position );
	        }
	    });


	}// onCreate

}// class
