How can I lock the screen from within the Windows 10 Mobile app?

北城余情 提交于 2019-12-19 11:29:16

问题


I was searching through UWP API Reference and I didn't find any way how to Lock the device from within app or with Secondary Tile.

And I am frustrated, because there is a proof that it can be done. I don't want to make any advertisements here but for example this app: https://www.microsoft.com/en-us/store/apps/quicktiles/9wzdncrfhzts Can create secondary tile that just locks the screen.

How can I do it myself?

Thanks.


回答1:


I don’t think it is possible with the UWP libraries. I tried to do an app able to lock the screen and had to give up few week-end ago.

You could vote for such idea here :

  • https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/2854511-provide-api-to-lock-unlock-the-screen-and-provi
  • https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/6220483-api-to-lock-the-screen

Reading the review of the application you mentioned it seems it use a “hack” to achieve the lock screen but it seems to have side effects:

  • “After locking phone, the device is very hot and battery down very fast. Please fix it.”
  • “However after lock screen, it cause phone very hot and extreme battery drain”
  • “ sometimes after i lock the screen, the battery is getting hot until i unlock the phone”

I’m also very surprise that UWP do not offer such functionality…



来源:https://stackoverflow.com/questions/35304930/how-can-i-lock-the-screen-from-within-the-windows-10-mobile-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!