lockToLandscapeOrientation

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

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

Parameters

phone

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

tablet

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