I need Activity A to retrieve the string value from a textview in Activity B. The catch is I don’t want Activity B to send the data, I just want Activity A to reach out and grab the data from B. I understand about Bundles and Intents, but the problem I’m having is that every time Activity B is accessed, it sends the bundled intent to A. I don’t want that to happen, I just want Activity A to grab the string from Activity B’s textview whenever Activity A is accessed. I’m using Android 2.2 and SDK 8.
Share
If I understand it correctly, your problem is that Activity A and Activity B are not talking so you need to access a certain data from A without involving B.
Imho you can solve this problem saving the data somewhere that is shared by both Activities.
You can use one of the options listed here in the Data Storage chapter:
http://developer.android.com/guide/topics/data/data-storage.html
I would go with shared preferences if it’s just a simple string.
That said, it’s not really clear what you want.