I have two different methods that do different things. When the is open and second close, All work wonderful, when the second method open and first close, all work wonderful. the problem happened when they both open.In this case the first method falls(i click on item and for a second see alert dialog with two options : yes/no). Can you please tell me where is error?
Thank you
/*first method*/
Thank you
/*first method*/
Code:
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
AlertDialog dialog = new AlertDialog.Builder(this)
.setMessage("Choose one of the options!")
.setPositiveButton("Yes", new HandleAlertDialog())
.setNeutralButton("No",new HandleAlertDialog())
.setCancelable(false)
.create();
dialog.show();
}
public class HandleAlertDialog implements DialogInterface.OnClickListener
{
[USER=1021285]@override[/USER]
public void onClick(DialogInterface dialog, int which) {
if (which==-1){
moh.deleteNameByNumber(id);
}
}
}
/*second option*/
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Name n = (Name) nameAdapter.getItem(position);
Intent i= new Intent(MainActivity.this, Information.class);
startActivityForResult(i,0);
}
Last edited by a moderator: