小编use*_*295的帖子

Android Gridview和Button OnItemclick

这是我认为准确的buttonAdapter类:

package com.example.test;

import android.content.Context; 
import android.graphics.Color; 
import android.view.View; 
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button; 
import android.widget.GridView;

public class ButtonAdapter extends BaseAdapter { 
    private Context mContext; 
    public String [] fName = { "File 1", "File 2", "Roflcopters"};

    // Gets the context so it can be used later 
    public ButtonAdapter(Context c) { mContext = c; }

    // Total number of things contained within the adapter 
    public int getCount () { return 8; }

    // Require for structure, not really used in …
Run Code Online (Sandbox Code Playgroud)

android gridview onitemclicklistener onitemclick

4
推荐指数
1
解决办法
1万
查看次数