Activity 之间的数据传递四种 (随记六)

来源:互联网 发布:网络电玩数据修改 编辑:程序博客网 时间:2024/06/16 10:47
  Intent intent=new Intent();  1)第一种方式   intent.putExtra("phone","10086");   new Bundle()-----> new ArrayMap--->(key,value)   2)第二种方式   Bundle bundle=new Bundle()   intent.putExtras(bundle);   3)第三种方式   User--->序列化
   intent.putExtra(String name, Serializable value)
4)第四种方式:Application A:MApplication extends Applicatoin(有个共享数据的对象) B:在AndroidManifest.xml 注册:<application name=""/>

0 0
原创粉丝点击