lockToOrientation

fun Activity.lockToOrientation(type: Int, phone: Boolean = false, tablet: Boolean = false)

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

Parameters

type

The orientation to lock to

phone

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

tablet

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