1 /* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * xscreensaver, Copyright (c) 2016 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 * Live Wallpaper preferences.
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 XScreenSaverActivity extends Activity {
32 protected void onCreate(Bundle savedInstanceState) {
33 super.onCreate(savedInstanceState);
35 setContentView(R.layout.activity_xscreensaver);
37 findViewById(R.id.apply_wallpaper)
38 .setOnClickListener(new View.OnClickListener() {
40 public void onClick(View v) {
47 private void openList() {
49 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
50 intent = new Intent(Settings.ACTION_DREAM_SETTINGS);
52 intent = new Intent(Settings.ACTION_DISPLAY_SETTINGS);
54 startActivity(intent);