On-screen rotation the page will reload and video not continue | RocketWeb Android

I buy RocketWeb from codecanyon and complete setup everything was fine but when I rotate the screen the page is reload and video play from begin.

If you are using RocketWeb version 1.4 or above then must enable JavaScript to fix this issue. Must test the app on a real device, not an emulator.


If you are using RocketWeb version 1.3.1 then just add this line on AndoirdManifest:

android:configChanges=”keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize”






If you are using RocketWeb version 1.3 or below then please upload below code on HomeActivity.kt and must test the app on a real device, not an emulator.

  1. Add this line of code where previously was loadBaseWebView()
if (savedInstanceState == null) {
loadBaseWebView()
}

2. Goto bottom of the page and add this line of code before onStart() or onResume()


override fun onSaveInstanceState(outState: Bundle?, outPersistentState: PersistableBundle?) {
super.onSaveInstanceState(outState, outPersistentState)
web_view.saveState(outState)
}

override fun onRestoreInstanceState(savedInstanceState: Bundle?) {
super.onRestoreInstanceState(savedInstanceState)
web_view.restoreState(savedInstanceState)
}

If you want to turn off orientation then add android:screenOrientation=”portrait” on AndroidManifest.xml

Leave a Reply