本文介绍了如何通过URI来的意图是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想要一个URI的对象传递到我的意图,以使用URI 在另一项活动...
I'm trying to pass a URI-Object to my Intent in order to use that URI in another activity...
我如何通过一个URI?
How do I pass a URI ?
private Uri imageUri; .... Intent intent = new Intent(this, GoogleActivity.class); intent.putExtra("imageUri", imageUri); startActivity(intent); this.finish();
我如何在我的其他活动,现在用这个URI?
How do I use now this URI in my other activity?
imageUri = extras.getString("imageUri"); // I know thats wrong ...感谢你们
推荐答案可以存储URI作为字符串
you can store the uri as string
intent.putExtra("imageUri", imageUri.toString());
然后就转换回字符串像这样
and then just convert back to string like this
Uri myUri = Uri.parse(extras.getString("imageUri"));更多推荐
如何通过URI来的意图是什么?
发布评论