receiving Camera Picture from Fragment

Hey guys,

I used this code to get a camera Picture:

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

The only I had to change, is that I have to do it into a Fragment.

I'm getting the Picture (check with FileInfo) but then I get a null-reference when I am refreshing my Adapter:

        galleryListView.Adapter = new FilesAdapter(this.Activity, fileliste);

If I'm choosing a Picture from the camera it works perfect!

I think the Problem is the SendBroadcast call:

        else if ((requestCode == MainActivity.CAMERA_REQUEST) && (resultCode == Result.Ok))
        {
            Intent mediaScanIntent = new Intent(Intent.ActionMediaScannerScanFile);
            Uri contentUri = Uri.FromFile(camera_file);
            mediaScanIntent.SetData(contentUri);
            this.Activity.SendBroadcast(mediaScanIntent);
}

do I have to Change this call ?

Posts

  • TimElbertTimElbert USMember

    Hello Everybody,

    Is my question explained so badly, or why is nobody answering? I could reword something if it is not understandable, but I don't see anything wrong with my question...

    Need help!!!

    Tim

Sign In or Register to comment.