I have a class that extends from Dialog, that class is my Custom dialog. Now, what I have is a code that show the dialog, but it's executed in a OnClickListener of a button. The following code is my actual code:
colorpicker.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
System.out.println("initial"+color);
dialog = new ColorPickerDialog(Main.this, color);
dialog.show();
color=dialog.getfinalColor();
System.out.println("Final"+color);
drawView.changePaint(weight, color);
}
});
Whant I want is to execute:
color=dialog.getfinalColor();
System.out.println("Final"+color);
drawView.changePaint(weight, color);
when the dialog is closed.
I try to do :
while(dialog.isShowing==true){
color=dialog.getfinalColor();
System.out.println("Final"+color);
drawView.changePaint(weight, color);
}
But the app not crashes but don't do nothing, the app don't work fine with that code.
Any idea to make something like a onFinishDialogListener()
?