Android Question what about the webview when i press the homekey?

softbug

New Member
Licensed User
Longtime User
just a simple webview1 on the MainActivity. after open my app,click some page on the webview1, then press the homekey. when come in again by click the app icon, the webview1 refresh(because the MainActivity create again).

i see some APP can keep the orangril face. how did them can do that?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
If you press on the home button and then go back to the activity then the activity is not recreated (unless the device was low on memory).

If you want to load the last url then you need to track it and store it in a process global variable or in a file. You can use the OverrideUrl event to find the current url.

See StateManager (which doesn't do anything with WebViews): http://www.b4x.com/android/forum/threads/9777/#content
 
Upvote 0
Top