lockToPortraitOrientation

fun Activity.lockToPortraitOrientation(phone: Boolean = false, tablet: Boolean = false)

Lock the activity to portrait orientation on a phone, tablet or desktop.

Parameters

phone

Specifies if the activity should be locked to portrait orientation on a phone

tablet

Specifies if the activity should be locked to portrait orientation on a tablet