0

I have implemented an app in which i have a grdiview of images, each of which uses an onItemClickListener to redirect to another activity with 4 buttons. How can i make the image of that particular grdiview item change, based on which button is clicked on the corresponding activity which is opened. In other words, I am trying to make the result of one activity affect the appearence of the previous activity. I am aware that we can use static to do the same with variable, but in this case, I am not sure of what to do as static doesnt seem to work with gridview. Thanks

Shivam Bhalla
  • 1,879
  • 5
  • 35
  • 63
  • Here's a nice example on how to use `onActivityResult()` to pass data from an activity, to a previous one: http://stackoverflow.com/a/10407371/1271435 – Andy Res Jul 07 '13 at 15:08

1 Answers1

0

If you want to change anyting in activity A, based on result from activity B then activity A should use startActivityForResult() to start B and then process B's result in onActivityResult().

See docs to get more information.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141