Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1015463
  • 博文数量: 146
  • 博客积分: 3444
  • 博客等级: 中校
  • 技术积分: 1602
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-21 15:18
文章分类

全部博文(146)

文章存档

2014年(9)

2013年(3)

2012年(6)

2011年(44)

2010年(38)

2009年(46)

分类: 嵌入式

2011-12-26 12:05:53

  1. 以下代码由网友提供,未经测试。

  2. 发送
  3. Bundle bundle = new Bundle();
  4.             bundle.putSerializable("test", new SB(1,2));
  5.             Intent intent = new Intent(this, MyScreen.class);
  6.             intent.putExtras(bundle);
  7.             startActivity(intent);

接收
  1.     protected void onCreate(Bundle savedInstanceState)
  2.     {
  3.         // TODO Auto-generated method stub
  4.         super.onCreate(savedInstanceState);
  5.         setContentView(R.layout.djx2);
  6.         Bundle bundle=this.getIntent().getExtras();
  7.         s=bundle.getString("name");
  8.         SB sb=(SB)bundle.getSerializable("test");
  9.         System.out.println(sb.posy);
  10.     }
阅读(1729) | 评论(0) | 转发(0) |
0

上一篇:mac os x的快捷键

下一篇:c struct java 实现

给主人留下些什么吧!~~