intent 传值
来源:互联网 发布:js取整 编辑:程序博客网 时间:2024/06/11 03:37
Intent参数传递
2011-9-21 08:59| 发布者: benben| 查看: 2755| 评论: 0
摘要: 当Activity与Activity/Service 参数传递,常用方法就是通过Intent实现例子:发送代码:Intentintent=newIntent(...);Bundlebundle=newBundle();bundle.putString("param","value");intent.putExtras ...
当Activity与Activity/Service 参数传递,常用方法就是通过Intent实现
例子:
发送代码:
- Intent intent = new Intent(...);
- Bundle bundle = new Bundle();
- bundle.putString("param", "value");
- intent.putExtras(bundle);
- context.startActivity(intent); 或 context.startService(intent);
接收代码:
- Bundle bunde = intent.getExtras();
- String name = bunde.getInt("param");
注意键值要一致。
0 0
- Intent传值
- intent传值
- intent 传值
- Intent 传值
- Intent传值
- Intent传值
- Intent传值
- intent 传值
- Intent传值
- Intent传值
- intent传值
- Intent传值
- Intent传值
- Android Intent传值
- Intent Activity传值
- Android--Intent传值
- Intent+Bundle 传值
- Android Intent 传值 --onActivityResult
- SQLite数据库2
- java 父类与子类的转换
- SQLite数据库3
- listener的多种写法
- 静态内部类
- intent 传值
- Toast 在service中出现的问题
- 查看service是否存在
- 继承与派生
- POJ1739
- 证明算法复杂度
- Android实现程序前后台切换效果
- Activity的LaunchMode和taskAffinity
- android手机定位不准的问题