How to send a die with the "setResult" of a non-activity to an Activity?

Asked

Viewed 51 times

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.

  • My dialog is a pure java class only with this setResult line, there is nothing else.

  • It’s not cool to hook things up like this. Maybe you can use something similar to what is recommended to do Fragmentcommunicate with Activitys. Have a look at this: http://developer.android.com/intl/pt-br/training/basics/fragments/communicating.html

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.