标签:his extras pos serial des string item parent roi
定义要传递的类事,必须加上
public class Movie implements Serializable { }
传入类:
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Movie movie= movieList.get(position); Intent intent = new Intent(MovieActivity.this, EditMovie.class); Bundle bundle = new Bundle(); bundle.putSerializable("movie", movie); intent.putExtras(bundle); startActivity(intent); }
接受类:
Movie movie = (Movie) getIntent().getSerializableExtra("movie"); String name = movie.getName(); String desc = movie.getDesc(); editText1.setText(name); editText2.setText(desc);
标签:his extras pos serial des string item parent roi
原文地址:http://www.cnblogs.com/farewell-farewell/p/6815939.html