I have two activities, A and B. If A is started and then B is started, the A goes to onPause.
In this situation, if I want to update UI of Activity A, what should I do?
I don’t have any problem with it on emulator. I mean in this situation I can update UI of Activity A without any problem, but it doesn’t work on a real device(cell phone) and noting changed.
What is the solution/solutions?
Thank you in advance.
Because A is paused, there is no need to update the UI (textviews, listviews, spinners, whatever). You may be talking about update some info inside A from B. If you want to pass some new information from B to A, you should the
startActivityForResult()method or similar to let A wait for some results, and pass some extras from B to A. Then, you can truly update A’s UI fromonResume()method (you need to override it)Get an example here