在我的 android 应用程序中。我有 gridview。在对网格视图的选择项之一执行操作后,我想将该项的可见性设置为 false。如何执行此操作?
代码如下 -
public void onItemClick(AdapterView<?> arg0, View arg1, int no,long lg) {
// TODO Auto-generated method stub
AlertDialog.Builder alert = new AlertDialog.Builder(MainActivity.this);
id=no;
alert.setTitle("Title");
alert.setMessage("Message");
alert.setIcon(flag[no]);
// Set an EditText view to get user input
final EditText input = new EditText(MainActivity.this);
alert.setView(input);
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
String value = input.getText().toString();
// Do something with value!
System.out.println("mmmm"+value);
if(value.equalsIgnoreCase(country[id])){
// here i want to set item visibility..
}
else
{}
}
});
alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// Canceled.
}
});
alert.show();
}
});