Skip to content

How to pick a display orientation

Prerequisite: Requires Insight Mobile v1.2.0 or higher.

Insight Mobile comes with a dialog to pick the orientation of a display device.

To show the dialog, use the following sample code:

val error = pgManager.showPickDisplayOrientationDialog(context)
if (error != null) {
    Toast.makeText(context, error.toString(), Toast.LENGTH_SHORT).show()
}
// Note: In case Android's pinned application mode is used, ```context``` must be the pinned activity. 
val intent = Intent()
intent.component = ComponentName(
    "de.proglove.connect",
    "de.proglove.coreui.activities.DisplayOrientationActivity"
)
startActivity(intent)
// Note: In case Android's pinned application mode is used, `startActivity` must be executed on the `context` of the pinned activity.
context.startActivity(intent)