I\'ve implemented my class with serializable, but it still didn\'t work.
This is my class:
package com.ursabyte.thumbnail;
import java.io.Serializab
This code may help you:
public class EN implements Serializable {
//... you don't need implement any methods when you implements Serializable
}
Putting data. Create new Activity with extra:
EN enumb = new EN();
Intent intent = new Intent(getActivity(), NewActivity.class);
intent.putExtra("en", enumb); //second param is Serializable
startActivity(intent);
Obtaining data from new activity:
public class NewActivity extends Activity {
private EN en;
@Override
public void onCreate(Bundle savedInstanceState) {
try {
super.onCreate(savedInstanceState);
Bundle extras = getIntent().getExtras();
if (extras != null) {
en = (EN)getIntent().getSerializableExtra("en"); //Obtaining data
}
//...