[Bug] Asus zendfone 2: cannot update image after capturing by camera
See original GitHub issueBug
Version Number of Plugin: 2.6.0 Device Tested On: Asus Zendphone 2 (android 5.0) Simulator Tested On:
Expected Behavior
When I capture image, or pick image from gallery, the image should be updated to the image view.
Actual Behavior
Nothing was updated because the content page was reinitialized.
Steps to reproduce the Behavior
- Create a screen, then add a button, a image view to the screen. Add these below codes after in the constructor of the content page.
- Run or debug program to device, then press capture button, or pick button to get image.
takePhoto.Clicked += async (sender, args) =>
{
await CrossMedia.Current.Initialize();
if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported)
{
DisplayAlert("No Camera", ":( No camera available.", "OK");
return;
}
var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
{
Directory = "Sample",
Name = "test.jpg"
});
if (file == null)
return;
await DisplayAlert("File Location", file.Path, "OK");
image.Source = ImageSource.FromStream(() =>
{
var stream = file.GetStream();
file.Dispose();
return stream;
});
//or:
//image.Source = ImageSource.FromFile(file.Path);
//image.Dispose();
};
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
[Phone] Troubleshooting - I cannot launch the Camera
1. Reboot your phone/pad and launch the camera again. · 2. Clear the camera data and cache : Go to Settings -> Apps...
Read more >Pictures Taken with Camera Doesn't Save in Gallery [Fixed]
Do you get unwanted issues with your phone, like the pictures taken with camera don't save in Gallery? Get the ways to fix...
Read more >ZenFone 2 Laser (ZE600KL) - Support
1.Fix the several issue in Line. · 2.Fix no LED Indicator option · 3.Fix unavailable to read photos which stored in Image Library...
Read more >Android Camera Not Working? 6 Common Issues and ...
3. The Camera App Is Missing on the Phone · Open the Settings app on your Android device. · Go to Apps. ·...
Read more >Snapchat bug?
Whenever I take a picture using the back camera and flash, the picture never gets taken? The camera just stays there with no...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Are you sure you don’t have kill activity on in your developer options?
Or try to add this line in your MainActivity: https://github.com/xamarinhq/app-evolve/blob/master/src/XamarinEvolve.Android/MainActivity.cs#L38
@jamesmontemagno Thank you, I resolved this problem. It because I checked on Kill Activity on Developer Option as you said before 😃