Android: Adding more than one Bundle to a new activity -


i'm trying pass in 2 separate pieces of information new activity in android application. have this:

bundle databundle = new bundle(); bundle extras = getintent().getextras(); // student id databundle.putint("id", 0);// lesson id intent intent = new intent(getapplicationcontext(),com.example.ltss.dyslexia.app.lessonnotes.class); intent.putextras(databundle); intent.putextras(extras); startactivity(intent); 

i have code accessing information. however, adding second bundle overrides first one.

bundle extras = getintent().getextras(); bundle studentid = getintent().getextras(); log.d("lessonid: ", string.valueof(extras)); log.d("studentid: ", string.valueof(studentid)); 

i need have information passed in separately need check if 1 of them null.

can i'm asking done? ideas how this? or way this? (parsing maybe?)

thanks

you use putextra("bundle1", bundle1) , putextra("bundle2", bundle2) , use getintent().getbundleextra("bundle1"); , getintent().getbundleextra("bundle2"); retrieve both


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -