I don't think the problem is that your bundle is null
. It can't be because you'd get a NullPointerException
much sooner.
The problem is that your error message is wrong. Change this:
if(b == null || !b.containsKey("WELL")) {
Log.v("BUNDLE", "bun is null");
} else {
// ...
}
To this:
if (!b.containsKey("WELL")) {
Log.v("BUNDLE", "bundle does not contain key WELL");
} else {
// ...
}
And the reason why the bundle doesn't contain this key, is because you didn't add it.