12

When I visit a website then switch to another app, then switch back to the browser the page is reloaded which I have just seen. It happens not just with builtin browser - I also tried Opera Mini and Maxthon.

How can I keep the recently seen page after resuming the browser?

Izzy
  • 91,166
  • 73
  • 343
  • 943
laplasz
  • 263
  • 2
  • 3
  • 9

3 Answers3

7

You can't prevent that. If the system (or App) reload the content, this is because it has decided to reload it. There is no option to prevent that.

But you can create your own browser that will handle the resume as you want ;)

  • 1
    Yeah, just to paraphrase, this is unfortunately due to the Android OS decided it needs to free up memory being used by the Browser by stopping it from being open in the background. Someone may have written a browser app that saves the page data and reshows it, even if the app's activity has been killed, however. Good answer. – Lance Nanek Sep 16 '12 at 21:41
  • 3
    I agree with the answer. I will add some speculation: the browser isn't actually reloading, in the sense of reissuing the HTTP GET request; rather, it's simply re-rendering the existing HTTP response that it presumably has lying around in its cache. I say this because I've seen this happen without network connectivity; if I then tap the "reload" button, it gives the error you'd expect ("Cannot load page because I cannot connect to the Internet" or whatever.) – offby1 Sep 16 '12 at 23:50
  • If it has decided to reload it, then it would have been a very bad decision since it would be "killed" the the ability to use apps simultanously. But the answer coming from @offby1 is right - there is a re-rendering instead of a reloading - so I would accept this answer – laplasz Sep 17 '12 at 08:24
  • I tried Google Chrome and it was worked as it should be! No rerendering at all - can somebody verify it? – laplasz Sep 17 '12 at 09:05
  • 3
    @laplasz: browsers had to rerender if it has been killed by the system (generally when a foreground apps needs more memory). With chrome, rerendering is a bit obvious because chrome displayed a grayscale screenshot of the page while it's rerendering. If you want to prevent rerendering at all, you should avoid switching to a heavy application (e.g. games). How much states are preserved across rerendering depends on the quality of implementation of the browser. – Lie Ryan Sep 17 '12 at 12:18
  • @LieRyan have you tried switching apps? When I am doing the ALT+TAB like app switching from built-in browser to Helloworld app and back, the re-rendering happens all the time. HelloWorld app needs no memory I think. So you think that Chrome makes rerendering but in a smart way? – laplasz Sep 17 '12 at 13:25
  • @laplasz: hmm... by itself switching apps (either by pressing Home key or by the task switcher) shouldn't kill the browser, something is a bit strange with your browser or the page perhaps that makes it have to close the browser and rerender all the time. How many tabs do you have in the built-in browser? Wild guess, but perhaps you have too many tabs open to fit the browser into the memory and that's why the built-in browser got killed as soon as it's no longer a foreground app, while Chrome has less tabs and stays around longer? – Lie Ryan Sep 17 '12 at 16:12
  • @LieRyan have you tried switching apps? i have 2.3.4 and the built-in browser only have 1 tab. please try it yourself with the built-in browser. (when I tried Chrome I tried at my colleges phone) – laplasz Sep 17 '12 at 16:25
  • Update - maybe this rerendering thing only happens before ICS, because now I tried the built-in browser in ICS, and there were no re-rendering at all. Can somebody confirm it, that this thing is depending on OS? – laplasz Sep 17 '12 at 16:33
  • @laplasz: IIRC, the stock browser on 2.3 does not do any rerendering, if the browser gets killed the page will be refreshed, and I think sometimes you may even lose the active tabs. However, even on those older versions, as long as the browser didn't get killed, you should still be able to switch to another application and go back to what you're doing. Since you're consistently getting a refresh every time, your browser must be getting killed for some reason; are you running an automatic task killers? – Lie Ryan Sep 17 '12 at 16:37
  • To be honest I have a custom rom - but i dont have any task killer app. I will try on original 2.3 software and come back with the result. Again, I have no tabs, just one active... – laplasz Sep 17 '12 at 17:02
  • @LieRyan by the way how can I check that browser gets killed or not after switching? and again when there is no data communication the browsers can open the page when I switch back - so no reloading as offby1 said – laplasz Sep 17 '12 at 17:25
0

You may try to use swap memory. It works for certain amount of time and relies on the quantity of apps you've got open at the same time and how heavy they are. Research about it, but you need unlocked bootloader and being root. Other option could be a device with more RAM (>= 1GB RAM).

Cheers.

-2

Just uncheck "Don't keep activities" from the "Developer options" under general Android settings.

wbrmx
  • 1
  • 1
  • Unrelated... It was unchecked already and it still happens. Are you sure that your web pages do not reload when you switch between tabs? – Domi Apr 17 '14 at 07:59