My bundle is returning null strings for the contained extras. Not NPEs, actual “null” values. Any ideas on why this would be happening?
new bundle
String u = null;
Bundle b = new Bundle();
Intent i = new Intent(view.getContext(), ******.class);
u = api.companyData.link.get(position);
Log.d("URL++++++++++++++++++++", u);
b.putString("graphic", api.companyData.graphic);
b.putString("name", api.companyData.name);
b.putString("url", u);
i.putExtras(b);
startActivity(i);
The log statement is returning the url fine.
Receiver of bundle
Bundle extras = getIntent().getExtras();
if(extras !=null) {
Log.d("EXTRAS", extras.getString("name")+extras.getString("graphic")+extras.getString("link"));
D/EXTRAS ( 4698): nullnullnull
I always do it this way:
and then
I’ve never tried it your way, but if you look at the Android docs for
putExtras(Bundle), it says:That you’re not doing that may be the reason for the failure.