java - Issue in Parcelable not found in 4.2 version device android -
i want integrate parcelable class in application. below code
getsecratekey.java
import android.os.parcel; import android.os.parcelable; public class getsecratekey implements parcelable { public string success = ""; public string message = ""; public string hasval=""; public string accsesskey=""; public string tenants_id=""; public string is_active=""; public string getis_active() { return is_active; } public void setis_active(string is_active) { this.is_active = is_active; } public string gettenants_id() { return tenants_id; } public void settenants_id(string tenants_id) { this.tenants_id = tenants_id; } public getsecratekey() { } public string gethasval() { return hasval; } public void sethasval(string hasval) { this.hasval = hasval; } public string getaccsesskey() { return accsesskey; } public void setaccsesskey(string accsesskey) { this.accsesskey = accsesskey; } public string getsuccess() { return success; } public void setsuccess(string success) { this.success = success; } public string getmessage() { return message; } public void setmessage(string message) { this.message = message; } @override public int describecontents() { // todo auto-generated method stub return 0; } @override public void writetoparcel(parcel dest, int flags) { // todo auto-generated method stub dest.writestring(success); dest.writestring(message); dest.writestring(accsesskey); dest.writestring(hasval); dest.writestring(tenants_id); dest.writestring(is_active); } public static final creator<getsecratekey> creator = new creator<getsecratekey>() { @override public getsecratekey[] newarray(int size) { return new getsecratekey[size]; } @override public getsecratekey createfromparcel(parcel source) { return new getsecratekey(source); } }; public getsecratekey(parcel in) { success = in.readstring(); message = in.readstring(); accsesskey = in.readstring(); hasval=in.readstring(); tenants_id=in.readstring(); is_active=in.readstring(); } }
main.java
public class main extends activity { getsecratekey mgetsecratekey; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.layout_login); mgetsecratekey=new getsecratekey(); }
when run code gave me error in my tablet 4.2 device below @ line mgetsecratekey=new getsecratekey();
java.lang.exceptionininitializererror @ pkg.android.rootways.worldofrental.loginactivity.oncreate(loginactivity.java:89) @ android.app.activity.performcreate(activity.java:5283) @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1097) @ android.app.activitythread.performlaunchactivity(activitythread.java:2209) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2295) @ android.app.activitythread.access$700(activitythread.java:150) @ android.app.activitythread$h.handlemessage(activitythread.java:1280) @ android.os.handler.dispatchmessage(handler.java:99) @ android.os.looper.loop(looper.java:175) @ android.app.activitythread.main(activitythread.java:5279) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:511) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1102) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:869) @ dalvik.system.nativestart.main(native method) caused by: java.lang.noclassdeffounderror: pkg.android.rootways.worldofrental.parser.getsecratekey$1 @ pkg.android.rootways.worldofrental.parser.getsecratekey.<clinit>(getsecratekey.java:95) pkg.android.rootways.worldofrental.main.oncreate(loginactivity.java:89)
Comments
Post a Comment