1 /* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * xscreensaver, Copyright (c) 2017 Jamie Zawinski <jwz@jwz.org>
4 * and Dennis Sheil <dennis@panaceasupplies.com>
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation. No representations are made about the suitability of this
11 * software for any purpose. It is provided "as is" without express or
14 * This is the XScreenSaver "application" that just brings up the
15 * Daydream preferences for Android TV.
18 package org.jwz.xscreensaver;
20 import android.app.Activity;
21 import android.app.WallpaperManager;
22 import android.content.ComponentName;
23 import android.content.Intent;
24 import android.os.Build;
25 import android.os.Bundle;
26 import android.view.View;
27 import android.provider.Settings;
29 public class TVActivity extends Activity
30 implements View.OnClickListener {
33 protected void onCreate(Bundle savedInstanceState) {
34 super.onCreate(savedInstanceState);
35 setContentView(R.layout.activity_tv_xscreensaver);
36 findViewById(R.id.apply_daydream).setOnClickListener(this);
40 public void onClick(View v) {
43 case R.id.apply_daydream:
45 Intent intent = new Intent(android.provider.Settings.ACTION_SETTINGS);
46 startActivityForResult(intent, 0);