How to use Android-L preview Task Locking?

前端 未结 2 415
走了就别回头了
走了就别回头了 2020-12-15 11:20

Has anyone got task locking working in Android L? Could they share some details on how it works? I have seen the instructions below, but struggling to understand this.

2条回答
  •  猫巷女王i
    2020-12-15 11:42

    Make a file device_owner.xml using below content, replace appropriate package name

    
    
    

    adb push device_owner.xml /data/system/device_owner.xml Reboot device.

    from com.your.packagename app call

    startLockTask(); 
    

    from your activity

    Even if you do not have userdebug, you can test it by calling startLockTask, without pushing any file

提交回复
热议问题