I followed this to capture Images form camera in webview
Here at this part its fine in android some versions and in some devices its working fine
But at android 5.0.1 when I capture image from webview its capturing and reloading the page again in that I am again redirecting to Login page
So i am Unable to upload but where as in Huvai p9 its wokring fine with android 6+ its working fine It stays fine and uploads the Image can any one suggest me what to do
Update 1
Now I tried many other ways like this
But its not working in some devices Please Help but in some devices its working fine...
According to me the activity that hosts the web view is destroyed as soon as you open the camera to take the picture. The camera is loaded in a separate activity, and this can cause the web view activity to be stopped and destroyed on devices with low memory.
Basically you have to manage this case, for example, in your onCreate where you will get a not null savedInstanceState bundle in case your activity has been destroyed and recreated. Check also the result that you get back in onActivityResult before loading content of the web view.
I faced with a same problem. My mistake was that i was doing that.
protected void onStart() {
super.onStart();
browser.loadUrl(siteUrl);
}
But onStart sometime fires after you select a file.
Maybe it will help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With