Я установил свой флажок Видимость для «Gone» в моем XML-файле, и я хочу отобразить его, когда я перехожу на OnItemLongListnere, на мой GridView, другими словами, если у меня есть 8 фото в моем gridView, я хочу отобразить этот CheckBox для каждой фотографии! БлагодаряCheckBox unhide on GridView
Мой GridViewAdapter
public class GridViewAdapter extends BaseAdapter {
// Declare variables
ImageView image;
private Activity activity;
private String[] filepath;
private String[] filename;
private static LayoutInflater inflater = null;
public GridViewAdapter(Activity a, String[] fpath, String[] fname) {
activity = a;
filepath = fpath;
filename = fname;
inflater = (LayoutInflater) activity
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
public int getCount() {
return filepath.length;
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
View vi = convertView;
if (convertView == null)
vi = inflater.inflate(R.layout.gridview_item, null);
// Locate the TextView in gridview_item.xml
TextView text = (TextView) vi.findViewById(R.id.text);
// Locate the ImageView in gridview_item.xml
image = (ImageView) vi.findViewById(R.id.grid_image);
// Set file name to the TextView followed by the position
File file = new File(filepath[position]);
Picasso.with(activity).load(file).placeholder(R.drawable.rtrt).fit().centerCrop().into(image);
// Decode the filepath with BitmapFactory followed by the position
// Set the decoded bitmap into ImageView
// image.setImageBitmap(bmp);
return vi;
}
}
разместим ваш адаптер для просмотра сетки –
я разместить его! :) –
Мне нужен ваш XML-код 'R.layout.gridview_item' –