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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -