Intent Bundle returns Null every time?
- by Max
I have some extras sent to a new intent. There it grabs the bundle and tests if it is null. Every single time it is null even though I am able to get the values passed and use them.
Can anyone see what is wrong with the if statement?
Intent i = getIntent();
Bundle b = i.getExtras();
int picked = b.getInt("PICK");
int correct = b.getInt("CORR");
type = b.getString("RAND");
if(b == null || !b.containsKey("WELL")) {
Log.v("BUNDLE", "bun is null");
} else {
Log.v("BUNDLE", "Got bun well");
}
EDIT: Heres where the bundle is created.
Intent intent = new Intent(this, app.pack.son.class);
Bundle b = new Bundle();
b.putInt("PICK", pick);
b.putInt("CORR", corr);
b.putString("RAND", "yes");
intent.putExtras(b);
startActivity(intent);