I'm currently developing an android application that makes use of Google Places API.
I have 2 activities that I want to pass a variable between. I have tried passing by Intent using putExtras and getExtras.
I have been having issues with the getExtras. I have debugged my code, used breakpoints and an output of the variable to the log.
Here is my code for the activity of which I want to pass the variable from:
Intent mapIntent = new Intent(getBaseContext(), MapsActivity.class);
Spinner distanceSpinner = (Spinner) findViewById(R.id.spinner_distance);
String radius = distanceSpinner.getSelectedItem().toString();
mapIntent.putExtra("radius", radius);
Log.e("Passer", String.valueOf(radius)); //Shows that value is not = null.
startActivity(mapIntent);
The log out put for this class is correct and displays the variable.
Here is the code for my class that I want to pass the variable to:
Intent filterIntent = new Intent(getBaseContext(), LocateFilterActivity.class);
Bundle bd = filterIntent.getExtras();
String radius= (String) bd.get("radius");
Log.e("TESTER", String.valueOf(radius));
startActivity(placeIntent);
The log does not actually output anything for this class. I know it can reach and execute the line of code through debugging.
I have tried coding this several different ways following previous SO questions/answers but not having much luck.
Any help would be much appreciated :)