定义要传递的类事,必须加上

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);

Android——使用 Intent传递类的更多相关文章

  1. Android 通过 Intent 传递类对象或list对象

    (转:http://www.cnblogs.com/shaocm/archive/2013/01/08/2851248.html) Android中Intent传递类对象提供了两种方式一种是 通过实现 ...

  2. Android 通过 Intent 传递类对象

    Android中Intent传递类对象提供了两种方式一种是 通过实现Serializable接口传递对象,一种是通过实现Parcelable接口传递对象. 要求被传递的对象必须实现上述2种接口中的一种 ...

  3. android通过 Intent 传递类对象

    Android中Intent传递类对象提供了两种方式一种是 通过实现Serializable接口传递对象,一种是通过实现Parcelable接口传递对象. 要求被传递的对象必须实现上述2种接口中的一种 ...

  4. Android中Intent传递类对象的方法一(Serializable)

    Activity之间通过Intent传递值,支持基本数据类型和String对象及它们的数组对象byte.byte[].char.char[].boolean.boolean[].short.short ...

  5. Android 开发笔记——通过 Intent 传递类对象

    Android中Intent传递类对象提供了两种方式一种是 通过实现Serializable接口传递对象,一种是通过实现Parcelable接口传递对象. 要求被传递的对象必须实现上述2种接口中的一种 ...

  6. Android中Intent传递对象的两种方法(Serializable,Parcelable)

    今天要给大家讲一下Android中 Intent中如何传递对象,就我目前所知道的有两种方法,一种是Bundle.putSerializable(Key,Object);另一种是 Bundle.putP ...

  7. [转]Android中Intent传递对象的两种方法(Serializable,Parcelable)

    http://blog.csdn.net/xyz_lmn/article/details/5908355 今天要给大家讲一下Android中Intent中如何传递对象,就我目前所知道的有两种方法,一种 ...

  8. Android高手进阶教程(十七)之---Android中Intent传递对象的两种方法(Serializable,Parcelable)!

    [转][原文] 大家好,好久不见,今天要给大家讲一下Android中Intent中如何传递对象,就我目前所知道的有两种方法,一种是Bundle.putSerializable(Key,Object); ...

  9. Android——通过Intent传递一些二进制数据的方法有哪些

    1.方法 (1)使用Serializable接口实现序列化.利用Bundle.putSerializable(Key, Object);这里objec对象需要实现serializable接口. (2) ...

随机推荐

  1. e787. 用JSpinner实现小时选择

    // Create a calendar object and initialize to a particular hour if desired Calendar calendar = new G ...

  2. 目标检测之dpm---hog的最优升级版

    http://blog.csdn.net/ttransposition/article/details/12966521 http://blog.csdn.net/carson2005/article ...

  3. Keystone-all 命令

    本文档介绍Icehouse版keystone-all命令 keystone-all命令在一个进程中同时启动服务和管理API,为openstack提供服务目录,授权和身份认证服务. 用法 $ keyst ...

  4. 用好这6个APP,学英语SO EASY!

      http://www.jianshu.com/p/30a27af18340  

  5. js简单Base64编码解码

    var str = 'javascript'; window.btoa(str) //转码结果 "amF2YXNjcmlwdA==" window.atob("amF2Y ...

  6. EXCEPTION:FATAL: UNABLE TO CREATE ‘…GIT/INDEX.LOCK’ FILE EXISTS

    FATAL: UNABLE TO CREATE ‘…GIT/INDEX.LOCK’ FILE EXISTS Hi, Today I will share you my other experience ...

  7. 标准代码页(codepage)列表

    https://blog.csdn.net/jianggujin/article/details/80325461 这篇文章有待完善 代码页 简称 全称 37 IBM037 IBM EBCDIC (U ...

  8. @PropertySource加载文件的两种用法以及配置文件加载顺序

    第一种: 现在我把资源文件的路径放在application.properties里 config.path=/home/myservice/config.properties @PropertySou ...

  9. Explore Basic Behavior of the TurtleBot ---3

    原创博文:转载请标明出处(周学伟):http://www.cnblogs.com/zxouxuewei/tag/ Introduction 此示例帮助您使用turtlebot的自主性. 驱动机器人向前 ...

  10. 解决Spring Boot中,通过filter打印post请求的 request body 问题

    http://slackspace.de/articles/log-request-body-with-spring-boot/ (filter + RequestWrapper:最优雅的写法) ht ...