-
Notifications
You must be signed in to change notification settings - Fork 85
MediaPicker TakePhoto is not working for Sony Experia L #21
Comments
I've just realized that this issue is somewhat related to #17 |
Was able to confirm this on an Experia Mini, investigating. |
It's not as you're right, it shouldn't. It looks like that the Experia's camera app is respecting --- a/MonoDroid/Xamarin.Mobile/Media/MediaPickerActivity.cs
+++ b/MonoDroid/Xamarin.Mobile/Media/MediaPickerActivity.cs
@@ -158,11 +158,11 @@ namespace Xamarin.Media
// Not all camera apps respect EXTRA_OUTPUT, some will instead
// return a content or file uri from data.
- if (data != null) {
+ if (data != null && !data.Equals (path)) { |
I'm currently on a short 2 day vacation and I'll only be able to test it on Wednesday 4th of December. If no one tries it before, I'll give my feedback Wednesday morning. Thank you for the help! José Pereira From: Eric Maupinmailto:[email protected] I'm not sure if this is the best place to solve this bug. Not sure if the execution should reach this point in this case scenario. It's not as you're right, it shouldn't. It looks like that the Experia's camera app is respecting EXTRA_OUTPUT, but providing back the path anyway which is different than some other apps. Unfortunately, I don't have an Experia device in front of me. @zleaohttps://github.com/zleao can you try this fix instead? --- a/MonoDroid/Xamarin.Mobile/Media/MediaPickerActivity.cs
— |
I ran a quick test with the changes you proposed and it works ok in a Sony Experia L. |
@zleao Just to be clear, you removed your changes first right? |
Yes @ermau , I removed my changes and tried only with yours |
I had the same problem with the Motorola Razr XT 910. I made the change in my code and now it works! Thanks a lot |
Fixed in 0c0b70e |
I've deployed the MediaPicker Sample to a Sony Experia L, and the Take Photo option is not working. The app does not crash. The camera capture window is shown, but after the capture, the resulting image is not shown.
After some debugging, I've realised that in the method
TryMoveAsyncFile(Context context, Uri url, Uri path, bool isPhoto)
the source and destination path's are the same. Because of that, the following lines will produce a FileNotFoundException:I've added a simple test before the
File.Delete
andFile.Move
, to check if the paths are equal. It looks something like:I'm not sure if this is the best place to solve this bug. Not sure if the execution should reach this point in this case scenario.
Any insights?
The text was updated successfully, but these errors were encountered: