when I pass this object with intent, its not starting the activity.
Custom object code
public class UserVo implements Serializable {
String name,id;
String can_reply,can_view;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getId() {
return id;
}
public String getCan_reply() {
return can_reply;
}
public void setCan_reply(String can_reply) {
this.can_reply = can_reply;
}
public String getCan_view() {
return can_view;
}
public void setCan_view(String can_view) {
this.can_view = can_view;
}
public void setId(String id) {
this.id = id;
}
Sending data through the intent
intent.putExtra("UserVo",vo);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
Receiving data
intent=getIntent();
UserVo vo= (UserVo) intent.getSerializableExtra("UserVo");
I also tried bundle, but it still does not work.
Look at this link Serializable:
To avoid it:
and remember that:
For best practise, I recommend you to use
Parcelable
. It's harder for coding but better for performance.