0
I have a class with a dialog that is not an Activity and the result of this dialog I need to update in Activity. To do this I am passing the Activity via constructor to the dialog, but it did not work. Does anyone know how and if it is possible to do this? Thank you in advance.
My attempt: act.setResult(Activity.RESULT_OK);
In fact I don’t even need to send a data to Activity, because I recover the data in Activity via bank, what I need is just to know if I clicked on a button in the dialog to get the data of the bank in my Activity.
Post the code of the dialog class.
– ramaral
My dialog is a pure java class only with this setResult line, there is nothing else.
– daniel12345smith
It’s not cool to hook things up like this. Maybe you can use something similar to what is recommended to do
Fragment
communicate withActivity
s. Have a look at this: http://developer.android.com/intl/pt-br/training/basics/fragments/communicating.html– Pablo Almeida