I have many other activities, and I need to pass these newly updated variables to some of these activities No, you don't You need to write a real data model (database, content provider, POJOs in a static data member) and have all activities refer to that common data model.
I have many other activities, and I need to pass these newly updated variables to some of these activities. No, you don't. You need to write a real data model (database, content provider, POJOs in a static data member) and have all activities refer to that common data model.
Yeah it seems like it, will move on with a database. – eightx2 Aug 7 at 21:20 To others that might have the same problem as I had initially, I can safely say that using a database is much easier. – eightx2 Aug 9 at 16:10.
It would be easier to just use a broadcast to inform the activities of changes.
Checked the documentation for it, but not quite sure how to implement it. – eightx2 Aug 7 at 15:49 Examples here – Earl Aug 7 at 16:04 I've already looked at that site, but those examples are good if you're going to use the phone state or similar. I just need my own activities, and I can't find an example in there that shows this.
– eightx2 Aug 7 at 16:09 In the broadcast receiver example, remove "android.intent.action. PHONE_STATE" from the intent filter and replace it with a name unique to your app.To send a broadcast to receivers use Intent intent = new Intent("my.unique. String"); sendBroadcast(intent); To send more information to the receivers, before sendBroadcast(), you can intent.
PutExtra("key", value); with any number of key/value pairs. – Earl Aug 7 at 16:23 Thanks, now it's possible for me to reach the onReceive method in the receiver. Now, how do I read the information from the extra in my new activity?
– eightx2 Aug 7 at 16:32.
This is going on in the main activity. During this process, many variables are being updated/changed. I have many other activities, and I need to pass these newly updated variables to some of these activities.
The problem is the fact that these activities are not started by my main activity. And then starting the activity using startActivity(newIntent1); from another activity? This doesn't work, the var1 variable is null (initialized as so).
To be honest, I have no idea how to do this, or how Intent. ParseUri even works. The documentation for this is really bad for a beginner like me.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.