Hi,

I hope that someone may be able to help with an issue I have accessing the
camera intent using an HTC Desire running Android 2.3.

I have an application which has a number of screens, one of which displays a
list of photographs already taken for a 'job' and allows the user to take
additional photographs which are then associated with the job.

My problem comes when trying to start the Camera Intent.  I really would
like to pass the name of the picture to be created to the Intent but
when-ever I try to do this (using Visual Studio 2010 in debug mode), my
application continues to run on the phone but the debugger quits at the
StartActivityForResult call - presumably some sort of exception but why the
app continues I don't know.

So then I thought I would skip the naming of the file and using another
example allow the system to name the file for me and return it.

In my OnActivityResult I have the following code :-


base.OnActivityResult(requestCode, resultCode, data);
if (requestCode == TAKE_PICTURE && resultCode == Result.Ok)
{
        string dataUri = data.ToURI();
        ImageView imageView = FindViewById<ImageView>(Resource.Id.takepic);
        imageView.SetImageURI(Android.Net.Uri.Parse(dataUri));
        
        // Save the photograph into the whereabouts
        Photograph photograph = new Photograph(fileName, 
_displayedJob.Worknumber,
false, false);
        Whereabouts whereabouts = SharedPreferences.Whereabouts();
        whereabouts.AddPhotograph(fileName, _displayedJob.Worknumber);
        SharedPreferences.Whereabouts(whereabouts);
}


my main problem here is that I need to get the actual name of the file
created so that I can store this in my Photograph object for later reference
as I will be uploading the image to a server.  

How can I get the actual name of the file from the URI?

Thanks for any suggestions/help

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Issues-accessing-the-Camera-Intent-tp5490893p5490893.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to