[英]Monodroid - ImageView -> SetImageURI crash application
I have an issue displaying a picture taken from the Camera. 显示从相机拍摄的照片时出现问题。 I proceed as the following: 我按以下步骤进行:
I get the "Application had to close unexpectedly" thing.. 我得到“应用程序不得不意外关闭”的东西。
Not really handy to debug. 调试起来并不方便。
There's the code for the Activity: 有该活动的代码:
[Activity (Label = "ViewPhoto")]
public class ViewPhoto : Activity
{
ImageView image;
protected override void OnResume ()
{
string PhotoLocation = Intent.GetStringExtra ("PicLoc");
Android.Net.Uri _img = Android.Net.Uri.Parse (PhotoLocation);
image.SetImageURI (_img);
}
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView(Resource.Layout.PhotoViewer);
image = FindViewById<ImageView> (Resource.Id.exCurrentPhoto);
}
}
I checked the picture weight.. it's 9kb (its probably a simple picture generated through the android emulator I use).. so I doubt it's a memory issue oo 我检查了图片的权重..它是9kb(可能是通过我使用的android模拟器生成的简单图片)..所以我怀疑这是内存问题oo
Thanks for helping. 感谢您的帮助。
I hate myself for not noticing I had forgotten to call the base.OnResume() function... Without exception being thrown I didn't realise until I randomly had to go through the Android LogCat x) 我讨厌自己没有注意到我忘记了调用base.OnResume()函数...无一例外地抛出,直到我随机不得不通过Android LogCat x时我才意识到
Problem solved =D 解决的问题= D
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.