Hi all,
I followed this example Grid View | Android Developers
and built a similar code (with small alterations).
I am at this point:
where the commented lines are wrong and I am unsure how to fix them. What I want to do is find the image at a memorized position and hide it together with the current selected one.
Thanks in advance.
I followed this example Grid View | Android Developers
and built a similar code (with small alterations).
I am at this point:
Code:
gridview.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
Toast.makeText(Main.this, mThumbVal[position].toString(), Toast.LENGTH_SHORT).show();
if(initialized){
if(mThumbVal[position] == mThumbVal[clicked]){
Toast.makeText(Main.this, "Match", Toast.LENGTH_SHORT).show();
v.setVisibility(4);
try{
//View vv = (View)gridview.findViewById(clicked);
//vv.setVisibility(4);
}
catch(Exception ee){
Toast.makeText(Main.this, ee.getMessage(), Toast.LENGTH_SHORT).show();
}
}
initialized=false;
}
else{
initialized=true; clicked = position;
}
}
});
where the commented lines are wrong and I am unsure how to fix them. What I want to do is find the image at a memorized position and hide it together with the current selected one.
Thanks in advance.