我的gridview中有imageview。我想禁用在android的gridview中单击的当前项目/图像。我无法做到这一点。如何做到这一点?这是一个代码-
@Override
public void onItemClick(AdapterView<?> arg0, View v, int no,long lg) {
// TODO Auto-generated method stub
final AlertDialog.Builder alert = new AlertDialog.Builder(MainActivity.this);
id=no;
final EditText input = new EditText(MainActivity.this);
alert.setView(input);
alert.setPositiveButton("Check", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
String value = input.getText().toString();
AlertDialog.Builder alert1 = new AlertDialog.Builder(MainActivity.this);
if(value.equalsIgnoreCase(country[id])){
// here i want to disable item
alert1.setPositiveButton("Correct", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
}
});
}
else
{
}
}
});
alert.show();
}
});