androidscreensaver

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


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.


Solution

  • final Intent intent = new Intent(Intent.ACTION_MAIN);
    intent.setClassName("com.android.systemui", "com.android.systemui.Somnambulator");
    startActivity(intent);
    

    Sample app available here.