I have an Activity whose layout is in the file main.xml that contains a TextView with the id my_view and a Button with the id open_alert. Clicking on the button will open an AlertDialog which is dismissed on clicking ok. Once the AlertDialog is cancelled i need to update the value of the TextView from the activity.
I am not able to update the value of TextView from the activity.
One way is to restart the activity on the OnClickListener in your Alert. If you want to pass a value into the view, just add an extra attribute in the intent and reset the value in the TextView. I have posted a rough code for reference.
and in your activity
Don’t know if this is the most efficient way to do it, but should work.