package com.example.gallery;
import android.os.Bundle;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Gallery;
/**
*
* @author TXF
*
* 用Gallery(画廊)实现图片的无限循环
*
*/
@SuppressLint("ShowToast")
public class MainActivity extends Activity {
@SuppressWarnings("deprecation")
private Gallery mga;
private Context mcontext;
private Integer[] mImageIds = { R.drawable.a, R.drawable.b, R.drawable.c,
R.drawable.d, R.drawable.e };
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// 通过findViewById找到galle
|