teja2495
9/19/2018 - 8:53 AM

Sending data to other Intent using Serializable

Data user;

if(getIntent() != null && getIntent().getExtras() != null){
    user = (data) getIntent().getExtras().getSerializable(MainActivity.data_key);
}
static String data_key;

myintent=new Intent(MainActivity.this, SecondActivity.class);
myintent.putExtra(data_key, user); //user class should implement serializable.
startActivity(myintent);