package com.example.gridview;

import java.util.ArrayList;
import java.util.HashMap;

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

public class MainActivity extends Activity {
private GridView mViewthreeGridView;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		int[] picId = { R.drawable.d_heng, R.drawable.d_huaxin,
				R.drawable.d_keai, R.drawable.d_kelian, R.drawable.d_ku,
				R.drawable.d_kun, R.drawable.d_landelini, R.drawable.d_lei,
				R.drawable.d_lvxing, R.drawable.d_nanhaier, R.drawable.d_heng,
				R.drawable.d_heng, R.drawable.d_heng, R.drawable.d_heng,
				R.drawable.d_heng, R.drawable.d_heng };
		String[] picName = { "中国春节", "中国春节", "中国春节", "中国春节", "中国春节", "中国春节",
				"中国春节", "中国春节", "中国春节", "中国春节", "中国春节", "中国春节", "中国春节", "中国春节",
				"中国春节", "中国春节" };
		mViewthreeGridView=(GridView) findViewById(R.id.homeactivity_viewpageritemone_threeSkipe_gridview);
		ArrayList<HashMap<Integer,String>> mList=new ArrayList<HashMap<Integer,String>>();
		for (int i = 0; i < picId.length; i++) {
			HashMap<Integer,String> map=new HashMap<Integer, String>();
			map.put(picId[i],picName[i] );
			mList.add(map);
		}
		mViewthreeGridView.setAdapter(new MyViewthreeGridView(this,mList));
	}


}