2016-07-27 5 views
0

私はXamarin Androidプロジェクトの画像を持つアクティビティにImageViewを持っています。ボタンをクリックしてその画像を別のアクティビティに渡す必要があります。Xamarin Androidのあるアクティビティから別のアクティビティに画像を渡すにはどうすればよいですか?

Intent intent = new Intent(this, typeof(SecondActivity)); 
intent.PutExtra("Key", "Value"); 

私は上記の文字列などを渡す方法を知っていますが、どうすれば画像を渡すことができますか?アクティビティ間のデータの受け渡し

答えて

0

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); 

出典:

https://developer.xamarin.com/recipes/android/other_ux/camera_intent/take_a_picture_and_save_using_camera_app/

関連する問題