I've made a list of data that I'm trying to pass on to another activity.
public class MyData extends ParseObject implements Serializable {
String name = "Tony";
public String getName()
{
return getString("name");
}
}
MyMainActivity:
List<MyData> data;
MyData temp;
so here's what I did:
temp = data.get(1);
Intent i = new Intent(MainActivity.this, AnotherActivity.class);
i.putExtra("dataTag", temp);
startActivity(i);
and on the other activity...
MyData newFile;
newFile = (MyData) getIntent().getSerializableExtra("dataTag");
when I log the newFile
, it returns the data as ParseObject
. But when I try to get its attribute, such as name, etc. it returns null. I wonder what I'm doing wrong.