How can we pass any value (selected one) from dialog to activity in android? -


i need pass values custom dialog activity. cannot understand should use. used intent, dialog doesn't support intent value passing . can me here, totally stucked.if have basic example it, excellent. thank you.

snippet google documentation:

// alert dialog code (mostly copied android docs alertdialog.builder builder = new alertdialog.builder(this); builder.settitle("pick color"); builder.setitems(items, new dialoginterface.onclicklistener() {     public void onclick(dialoginterface dialog, int item) {         myfunction(item);     } }); alertdialog alert = builder.create();  // elsewhere in activity class, have function private void myfunction(int result){     // data has been "returned" (as pointed out, that's not     // right terminology) } 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -