我是一名新程序员,在网格视图中单击图像时,我需要一种方法来启动新活动.我尝试过的一切都行不通.你有什么想法?我需要每个图像加载不同的活动.我有网格工作但只需要它来改变活动.
Java文件:
package your.pacage.names;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.Toast;
public class ImageAdapter extends BaseAdapter {
private Context mContext;
public ImageAdapter(Context c) {
mContext = c;
}
public int getCount() {
return mThumbIds.length;
}
public Object getItem(int position) {
return null;
}
public long getItemId(int position) {
return 0;
}
// create a new ImageView for each item referenced by the Adapter
public View getView(int position, View convertView, …Run Code Online (Sandbox Code Playgroud)