Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid extra with intent is always NULL
    primarykey
    data
    text
    <p>For some reason I am having trouble retrieving my bundle extras from my intent. I am adding my extras to pass to my new activity with:</p> <pre><code>public void getMap(View view){ Intent i = new Intent(this, BreweryYourTopBeers.class); Log.d("map" , e.beerBreweryId); i.putExtra("breweryID", e.beerBreweryId); i.setClass(this, BreweryMap.class); startActivity(i); } </code></pre> <p>Looking at my LOG I can see that e.beerBreweryId does in fact have a value before it is bundled and sent. </p> <p>But when I get to the next class I must not be retrieving the extras from my intent. I attempt to retrieve the value with:</p> <pre><code>public class BreweryMap extends ActionbarMenu { BeerData e; String beerID; GoogleMap map; //get beer details from bundle protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_brewerymap); //get brewery data //get beer data Intent intent = getIntent(); Bundle extras = intent.getExtras(); String breweryID = extras.getString("brewreyID"); map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)) .getMap(); //todo: get brewery latt and long and add marker //construct url String url = "http://api.brewerydb.com/v2/brewery/"+ breweryID +"?key=myKey&amp;format=json&amp;withLocations=y"; Log.d("map", url); //async task to get beer taste tag percents new myAsyncTask(this,map).execute(url); } </code></pre> <p>When I look at my log here the breweryID is always NULL and I can not figure out why. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload