I have an imageView created here in my GridViewAdapter class:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// Try to reuse the views
ImageView view = (ImageView) convertView;
boolean checked = (mCheckBox==null)?false:(((CheckBox) mCheckBox).isChecked());
// if convert view is null then create a new instance else reuse it
if (view == null) {
view = new ImageView(Context);
//view.setTag(ViewId(), "imageViewGRID");
view.setId(R.id.1);
Log.d("GridViewAdapter", "new imageView added");
}
But I'm not sure on how to use .setId so that I can use this imageView in another class in this line:
ImageView imageView1 = (ImageView)v.findViewById(R.id.1);
Can someone please clear up how this works?
Please note that I have also tried:
view.setTag("imageView4Grid");
with
ImageView imageView1 = (ImageView)v.findViewWithTag("imageView4Grid");
but I get an error