您如何以编程方式启动用户选择的Daydream? [英] How do you start the user's selected Daydream programmatically?

查看:119
本文介绍了您如何以编程方式启动用户选择的Daydream?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Galaxy Nexus上,我可以在系统偏好设置中点击此按钮以开始我当前选择的白日梦.

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

是否可以通过Intent在应用程序中重现此功能?我没有白日梦服务,但我想允许用户开始他们喜欢的白日梦.

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.

推荐答案

  • 编辑9/22/2014:这在某些三星手机上不起作用 我通过挖掘一些Android源代码来弄清楚如何做到这一点.
    • 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);
      

      此处提供示例应用.

      这篇关于您如何以编程方式启动用户选择的Daydream?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆