I would like pass object with Intent:
public class First extends Activity implements Serializable {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button here = (Button) findViewById(R.id.here);
here.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
Intent intent = new Intent(getApplicationContext(), MyClass.class);
Test test = new Test();
intent.putExtra("test", test);
startActivity(intent);
}
});
}
}
but this in line with intent.putExtra("test", test); return me error:
The method putExtra(String, boolean) in the type Intent is not applicable for the arguments (String, Test)
How can i make it?