Disable Landscape Mode In Android Application

As we have seen it creates so many problems when you rotate your device or when orientation is changed from portrait to landscape and vice-versa. However, there is a code to avoid that, but I have seen so many developers just disables landscape mode so that your application will be in portrait mode only all the time.

Whether rotation of device is on or off doesn’t matter, your application will be in portrait mode only.

To do that, you just need to add android:screenOrientation=”portrait” to an activity you have mentioned in the AndroidManifest.xml file.

Underlining text in TextView
Android DataBinding With Fragment