10

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

preferences screenshot

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.

Jacob Tabak
  • 8,044
  • 3
  • 24
  • 32

2 Answers2

13
  • 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.

Michael B
  • 1,660
  • 3
  • 28
  • 59
Jacob Tabak
  • 8,044
  • 3
  • 24
  • 32
0

Using adb

adb shell am start -n com.android.systemui/.Somnambulator

Gyl
  • 61
  • 6