I am developing an app that need to upload images to the server using WebView. But when user clicks on File Chooser button and selects Gallery or Camera to select the photo. My app restarts.
我正在开发一个需要使用WebView将图像上传到服务器的应用程序。但是,当用户单击“文件选择器”按钮并选择“图库”或“相机”以选择照片时。我的应用重启了。
This is surely a memory issue, because if I restart my mobile phone, it starts working fine.
这肯定是一个内存问题,因为如果我重启我的手机,它开始正常工作。
This issue is only seen on S3 and a few other devices. On most of the devices it works fine.
此问题仅出现在S3和其他一些设备上。在大多数设备上它工作正常。
Edit: The issue is not related to the IMAGE SIZE. Even if I choose the gallery to select the image and when the gallery opens I just click back button to go back to the app and the app restarts.
编辑:该问题与IMAGE SIZE无关。即使我选择图库来选择图像,当图库打开时,我只需单击后退按钮返回应用程序,应用程序将重新启动。
That means it has nothing to do with the image size. When the gallery opens in full screen and my app goes to background, Android kills my app because of low memory or something like that. But I don't know how to handle it.
这意味着它与图像大小无关。当画廊全屏打开并且我的应用程序转到后台时,由于内存不足或类似问题,Android会杀死我的应用程序。但我不知道如何处理它。
i am saving my webview state and restoring it....but its not helping
我正在保存我的webview状态并恢复它....但它没有帮助
2 个解决方案
#1
0
It's normal for the system to terminate your activities. What you can and should do is to write your app so that it can restore its state correctly. See the Android documentation Recreacting an Activity for more information.
系统终止您的活动是正常的。您可以而且应该做的是编写您的应用程序,以便它可以正确地恢复其状态。有关详细信息,请参阅重新创建活动的Android文档。
#2
#1
0
It's normal for the system to terminate your activities. What you can and should do is to write your app so that it can restore its state correctly. See the Android documentation Recreacting an Activity for more information.
系统终止您的活动是正常的。您可以而且应该做的是编写您的应用程序,以便它可以正确地恢复其状态。有关详细信息,请参阅重新创建活动的Android文档。