简体   繁体   中英

Android - Does Lollipop Screen pinning work across multiple activities in the same app?

I'm attempting to add kiosk functionality to an android application. I'm hoping to take advantage of Lollipop's screen pinning feature to automatically pin the app once it starts. The app UI has been built with several different activities. I call startLockTask() once during the onCreate() method of the entry-point activity however as soon as I navigate to another activity within the app it unpins.

Do I need to call startLockTask() in every activity during onCreate()/onResume() ? This will produce a poor user experience as the "Screen pinned" toast will appear every time I move from one activity to another within the app.

I'm developing the app on a Moto E (2nd gen) running Android 5.0.2.

Android Lollipop's Screen Pinning feature pins a Single Task NOT an Activity on the screen. So if your activities are in one single task then yes you can play/switch between activities in screen pinning mode.

For more details you can check this official information: https://developer.android.com/about/versions/android-5.0.html#Enterprise > Screen pinning

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM