我在Xamarin Android项目中的图像活动中有一个ImageView。我需要通过单击按钮将该图像传递给另一个活动。
Intent intent = new Intent(this, typeof(SecondActivity));
intent.PutExtra("Key", "Value");
我知道上面传递字符串等的方法但是如何传递图像?
答案 0 :(得分:1)
在活动之间传递数据
https://developer.xamarin.com/recipes/android/fundamentals/activity/pass_data_between_activity/
你会想要这样的例子:
Intent intent = new Intent (MediaStore.ActionImageCapture);
App._file = new File (App._dir, String.Format("myPhoto_{0}.jpg", Guid.NewGuid()));
intent.PutExtra (MediaStore.ExtraOutput, Uri.FromFile (App._file));
StartActivityForResult (intent, 0);
来源: