I'm trying to build an app which has a start screen with buttons leading to several different activities. In one of the activities subsequent to the start screen I get int values which I would like to use in another subsequent activity. From what I've seen values usually get passed between activities using bundles and intents sort of like this:
Intent i = new Intent(this, ActivityTwo.class); AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete); String getrec=textView.getText().toString();
//Create the bundle Bundle bundle = new Bundle();
//Add your data to bundle bundle.putString(“stuff”, getrec);
//Add the bundle to the intent i.putExtras(bundle);
//Fire that second activity startActivity(i);
and adding this in the second:
//Get the bundle Bundle bundle = getIntent().getExtras();
//Extract the data… String stuff = bundle.getString(“stuff”);
However I don't want my third activity to get started from the second one, is there a way to send a value without starting the other activity it is going to get used? If not should I pass the values to the start screen activity and from there to the other one and if so how?