android - Returning null with getExtras() -


i know has been asked many times, answers never seem apply.

activity 1:

public void buttonpress(view view){     intent = new intent(this,profilepage.class);       i.putextra("user_details", ud);     startactivity(i); } 

activity 2:

@override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_profile_page);     try{         userdetails ud = (userdetails)this.getintent().getextras().getparcelable("user_details");         ((textview)findviewbyid(r.id.first)).settext(ud.getfirst_name());         ((textview)findviewbyid(r.id.last)).settext(ud.getlast_name());     }catch (exception e) {         log.e("getting extras", e.tostring());     } } 

"ud" parcelable have returning correctly elsewhere. this.getintent().getextras().getparcelable("user_details") returning null. continue run problem, how fix or not getting?

try

userdetails ud = (userdetails) getintent().getparcelableextra("user_details"); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -