Friday 15 April 2011

android - How to pass a Parcelable Extra to another activity -


I am trying to pass an additional parcel to use another activity, but when I make it my second If I get on the activity, then NullPointerExeception show up, can someone help me?

My portable eligible class:

  implements the public category metadados parcelable {Private Ent Codigone Institute; // . . Public Metadados (Int Codinistivio, int ANO, string offlineUUdid, string signals, string name inst., String start date, string name, string end, long size) {this.codigoInstituicao = codigoInstituicao; // . . } Public int getCodigoInstituicao () {return codigoInstituicao; } Public Zero Set Codexinstitico (It CodoInstikico) {this.codigoInstituicao = codigoInstituicao; } // Gates and Setters . @ Override Public Intents () {// Tudo Auto-Generated Method Stub Returns 0; } @ Override Public Zero Editor (Parcel Dest, Int Flag) {dest.writeInt (codigoInstituicao); // . . } Public stable final portlet worthy. Manufacturer & lt; Metadados & gt; Manufacturer = new parcelable. Creator & lt; Metadados & gt; {} Return to the new Metadados (Inn); Made of Public Metadados Fraamperesell (Parcel Inn); } Public Metadados [] Newer (integer shape) {Return new metadados [size]; }}; Private Metadados (in Parcel) {codigoInstituicao = in.readInt (); // . . }}   

How my Asynchronous introduces my other activity:

  ArrayList & lt; MetaDados & gt; Metadosophal = new arreelist & lt; Metadados & gt; (); ArrayList & LT; MetaDados & gt; Metadados = New Arrestist & lt; Metadados & gt; (); Intentional = new intent (activity, download selection activity category); It.putExtra ("metadosophic", metadascus); It.putExtra ("Metadosporters", Metadedosparse); Activity.startActivity (this);   

And my download activation, where I try to get it:

  ArrayList & lt; MetaDados & gt; Fulllist = (arrelisted & lt; metadando & gt;) getIntent (). GetParcelableExtra ("Metadascusful"); (Metadado Metadados: FullList) for {Log D. (Constants.DOWNLOAD_SELECTED_ACTIVITY, Metadados.Getnam ()); } ArrayList & lt; MetaDados & gt; PresList = (ArrayList & lt; MetaDados & gt;) getIntent (). GetParcelableExtra ("Metadosporters"); (Log D. for Metadados Metadado: Prestist) (Constants.DOWNLOAD_SELECTED_ACTIVITY, MetadataGetname ()); }    

Use Intent.putParcelableArrayListExtra () instead of putExtra (), and getParcelableArrayListExtra ( ) Instead of getParcelableExtra () you can also lose the stopper, so that's where it's flying.

No comments:

Post a Comment