用gridview显示图片 并把图片信息传到另一个页面显示。当单击一item时就跳转到前一个页面进行编辑,这个功能该怎么实现
3 回答
溜达溜达
TA贡献106条经验 获得超19个赞
界面传值示例:
传值界面
Intent intent = new Intent(A.this, B.class);
/* 通过Bundle对象存储需要传递的数据 */
Bundle bundle = new Bundle();
/*字符、字符串、布尔、字节数组、浮点数等等,都可以传*/
bundle.putString("Name", "慕课网");
bundle.putBoolean("Isgood", true);
/*把bundle对象给Intent*/
intent.putExtras(bundle);
startActivity(intent);获取值界面
/*获取Intent中的Bundle对象*/
Bundle bundle = this.getIntent().getExtras();
/*获取Bundle中的数据,注意类型和key*/
String name = bundle.getString("Name");
boolean isgood = bundle.getBoolean("Isgood");- 3 回答
- 1 关注
- 1285 浏览
添加回答
举报
0/150
提交
取消
