Categories

Follow Us @web_learners

Tuesday, April 7, 2020

Prevent Reload Website on Screen Rotation in Android App | Webview App Development Series Part 9

Hi, In the previous post I have shown you How to Add Exit Dialog In Android Webview App. Today I am going to show you the solution to a common problem which every beginner face during the Android app development.

That is when you will rotate your mobile phone like the portrait to landscape mode, your website will reload. I will show you how can you solve this problem in Webview App.


You need to write code in the AndroidManifest.xml file. Inside "Application" tag you can see there have <activity android:name=" your activity file name" (here you have to write below code) ></activity> . you need to add this line in your all activity tag.

Code:


So, the whole code will be in AndroidManifest.xml file is:

Code:


That's it.you test your project now. As you can see in my above video, I have successfully prevented app reload during screen orientation change. Watch my video for a better understanding for making Webview App.

No comments:

Post a Comment