0
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub
    View gridView;
    if (convertView == null) {
        LayoutInflater inflater = (LayoutInflater)mContext.getSystemService(
                      Context.LAYOUT_INFLATER_SERVICE);
        gridView = new View (mContext);
        gridView = inflater.iflate(R.layout.gridview_item,null);
    }else {
        gridView = convertView;
    }
    TextView textView = (TextView)
    gridView.findViewById(R.id.grid_item_text);
    textView.setText(mThumbIds_Strings[position]);
    ImageView imageView = (ImageView) gridView.findViewById(R.id.grid_item_image);
    imageView.setImageResource(mThumbIds[position]);
    return gridView;
}

膨らませたい。gridview_itemのオブジェクトである既存のレイアウトを使用しますGridview。このコードを実行しようとすると、次のエラーが表示されます。

LayoutInflater inflater = (LayoutInflater)mContext.getSystemService(
    Context.LAYOUT_INFLATER_SERVICE);

TextView textView = (TextView)

ImageView imageView = (ImageView)
4

1 に答える 1