Reload the android web browser page after image capture and load in android 5+

I followed this to capture images to the camera using the camera

Here, in this part, it’s excellent in android, some versions and in some devices it works fine

But in android 5.0.1, when I capture an image from webview, it captures and reloads the page again, because I am redirected to the login page again

So I can’t download, but where, as in Huvai p9, its wokring works fine with Android 6+, it works fine. It stays alright and uploads the image. Anyone can suggest me what to do

Update 1

Now I have tried many other ways such as this

But it does not work on some devices. Please help, but in some devices its work is fine ...

+8
android upload webview camera
source share
1 answer

According to me, the activity that hosts the web view is destroyed as soon as you open the camera to take a picture. The camera loads in a separate action, and this can lead to the suspension and destruction of the web view activity on devices with low memory.

Basically, you need to manage this case, for example, in your onCreate, where you will get an empty unInstanceState card if your activity has been destroyed and recreated. Also check that you will return to onActivityResult before loading the contents of the web view.

+1
source share

All Articles