How do you start the user's selected Daydream programmatically?

不问归期 提交于 2019-12-09 06:22:25

问题


On my Galaxy Nexus, I can tap this button in system preferences to start my currently selected daydream.

Is there a way to reproduce this functionality in an app via Intent? I don't have a daydream service, but I would like to allow the user to start their preferred daydream.


回答1:


  • Edit 9/22/2014: This does not work on some Samsung phones I figured out how to do this by digging through some Android source code.
final Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName("com.android.systemui", "com.android.systemui.Somnambulator");
startActivity(intent);

Sample app available here.



来源:https://stackoverflow.com/questions/21369368/how-do-you-start-the-users-selected-daydream-programmatically

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