What is the \"correct\" way to return the values to the calling activity from a complex custom dialog - say, text fields, date or time picker, a bunch of radio buttons, etc,
I'm using following way:
private volatile Bundle controlBundle; with appropriate getter/setterWhen I start dialog, I used to call dialog thru my own method:
public void showMyDialog(int id, Bundle bundle)
{
this.controlBundle=bundle;
this.showDialog(id, bundle);
}
So each time I know parameters sent to dialog
Bundle with necessary values and then put them thru my Activity bundle setter:
((ControlActivity )this.getOwnerActivity).setControlBundle(bundle);
So in the end when dialog finishes I know value "returned" from dialog. I know that it's not like int retCode=this.showMyDialog(); it's a bit more complex, but it's workable.