There are two ways to activate screen pinning:
Manually: Users can enable screen pinning in Settings > Security > Screen Pinning, and select the tasks they want to pin by touching the green pin icon in the recents screen.
Programmatically: To activate screen pinning programmatically, call startLockTask() from your app. If the requesting app is not a device owner, the user is prompted for confirmation. A device owner app can call the setLockTaskPackages() method to enable apps to be pinnable without the user confirmation step.
There are two ways to activate screen pinning:
Manually: Users can enable screen pinning in Settings > Security >
Screen Pinning, and select the tasks they want to pin by touching the
green pin icon in the recents screen. Programmatically: To activate
screen pinning programmatically, call startLockTask() from your app.
If the requesting app is not a device owner, the user is prompted for
confirmation. A device owner app can call the setLockTaskPackages()
method to enable apps to be pinnable without the user confirmation
step.
To deploy and activate a device owner, you must perform an NFC data transfer from a programming app to the device while the device is in its unprovisioned state.
To deploy and activate a device owner, you must perform an NFC data
transfer from a programming app to the device while the device is in
its unprovisioned state.