package novoda.demo; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; class GridViewAdapter extends BaseAdapter { private final Context mContext; public GridViewAdapter(Context c) { mContext = c; } public int getCount() { return 16; } public Object getItem(int position) { return new Object(); } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent) { View view; if (convertView == null) { final LayoutInflater inflater = (LayoutInflater) mContext.getSystemService( Context.LAYOUT_INFLATER_SERVICE); view = inflater.inflate(R.layout.grid_item, null); } else { view = convertView; } return view; } }