In my hybrid Android application, on a ListView item click I'm loading a WebView by passing the WebView activity with the url to display in it. The user can come back to the earlier view by clicking back button.
But what is happening is after clicking on 3-4 ListView items, the app is becoming slow, which I think is because WebView activity is loaded again and again without deallocating it.
In the onDestroy() of the webview activity destroy the WebView as well. myWebView.destroy();
Related
I have a WebView full of images, videos & gifs. When the WebView is loading and user clicks on any links on the WebView it don't open immediately. Instead it loads all the contents on the WebView and then loads the clicked link.
Is there any way to stop loading remaining content as soon as any link is clicked on the WebView and open the clicked link ASAP?
I am developing a quiz app in which I have a profile page were the user can change their image when they needed. It was working properly, the profile page of the user is a fragment not an activity. I faced a problem recently that am able to pick image from gallery but cannot view it the fragment image view instead of viewing that fragment my last (i.e) the activity before this fragment is called. Can anyone please help me reg this.. ?
Let me explain my prob clearly:
I have a navigation drawer activity which contains four fragments. first I have a splash screen activity next comes the navigation were one of the fragment appears, which contains a couple of onClickListeners() in it which navigates to the corresponding activity. What I did here is when I press back button from the fragment I got the recently viewed activity since I killed that activity life cycle by giving finish().
Here raised the next problem, now when I try to press back button I got the fragment itself viewed and then the app got closed. For this I found a solution of giving finish() in onstop() in my navigation activity which holds all the fragments. So now that problem got solved for me.
Again I got another issue (i.e) in that four fragments one is profile page, where the user can update their profile photo from gallery. The problem here is when I try to change the profile photo it goes inside the gallery and when I picked a image, the fragment life cycle onStop() method is called and the app gets closed by itself. I want to stop this from happening.. please have a look and suggest me with some ideas.
I am working on an Android browser using WebView(s), and to maintain tabs, multiple webviews are open in a single activity, with 1 always VISIBLE, the rest GONE.
However, when one webview is loading (via .loadUrl()), and then switch to another tab, the 2nd webview with a page already loaded is unresponsive in the sense that I can't click on any links in that until the first webview is loaded.
I can still scroll.
How can I prevent this from happening?
Thanks!
I have a WebView and while it loads the page which takes some seconds I want to show something other than a white screen, so I'm loading static data before loading the first page
webview.loadDataWithBaseURL("/", wait_html, "text/html", "UTF-8", "");
Now, when I press the back button my activity is destroyed and when I restart it, more often than not, I get a warning like:
webcore Can't get the viewWidth after the first layout
and my static content is not displayed but the page that is loaded after is displayed without problems. So... any suggestions on how to make it show my static content?
I have an android app that uses a glSurfaceView that takes a few sections to load up.
I have onTouchEvent overridden, and I'm trying to disable focus while it loads but setFocusable(false) isn't working.
The problem is if the user taps on the screen before everything loads, the app gets a null and it crashes.
I'd pop up a progress dialog and use an AsyncTask to do the loading of the view. Once the view is loaded you can kill the dialog. Any heavy lifting should not be done on the UI thread anyway.