Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid:settingsActivity - how to get non-standard behavior
    primarykey
    data
    text
    <p>I have made a live wallpaper, which has many complex settings. Looking at various examples on the web it appears that the standard way to set preferences in a wallpaper is to have some xml like this:</p> <pre><code>&lt;wallpaper xmlns:android="http://schemas.android.com/apk/res/android" android:thumbnail="@drawable/my_icon" android:description="@string/wallpaper_description" android:settingsActivity="com.mycompany.mywallpaper.MyWallpaperSettings" /&gt; </code></pre> <p>Where <code>MyWallpaperSettings</code> is a class defined like this:</p> <pre><code>public class MyWallpaperSettings extends PreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener </code></pre> <p>with...</p> <pre><code>@Override protected void onCreate(Bundle blah) { super.onCreate(blah); getPreferenceManager().setSharedPreferencesName(MyWallPaper.SHARED_PREFS_NAME); addPreferencesFromResource(R.xml.my_settings); getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this); } </code></pre> <p>This all works as advertised, but it appears rather crude. I have noticed that the look and feel of some wallpaper's settings is far more sophisticated, or look nothing like the standard settings screens at all, some have a dialog that pops up, with buttons on that are links to websites. I am wondering how I can achieve this. Is it all about having fancier xml in my_settings.xml or perhaps the android:settingsActivity=.. points to something that isn't a PreferenceActivity, but rather just a normal activity? Or maybe the code within the oncreate needs to look different - I'm just not sure exactly where I should be deviating from the examples.</p> <p>Looking at developer.android.com it says "This is the base class for an activity to show a hierarchy of preferences to the user." - this sounds like I'm restricted to a narrow range of things I can do... that's why I'm torn between attempting to push the limits of what can be done inside a PreferenceActivity and making <code>android:settingsActivity=</code> point to something that simply isn't a PreferenceActivity at all (if that's allowed).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload