Wednesday, March 23, 2011

[android-developers] Re: How to include a button in the live wallpaper settings GUI?

Do you mean adding the button to the settings.xml file or to the
layout : main.xml file? The button was not visible when I added it to
the layout : main.xml file and the live wallpaper crashed when I added
it to the settings.xml file. Here is the code that I used:
---------------------------------------
settings.xml:

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/settings_title">


<ListPreference
android:key="Transparens"
android:title="Transparens"
android:summary="Choose how transparent it should be"
android:entries="@array/Transparens_names"
android:entryValues="@array/Transparens_values" />


<ListPreference
android:key="speed"
android:title="Speed"
android:summary="Choose how fast it should be"
android:entries="@array/speed_names"
android:entryValues="@array/speed_values" />


<Button android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button1" />


</PreferenceScreen>

-------------------------------------
layout : main.xml fil:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="hello"
/>

<Button android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button1" />


</LinearLayout>

On Mar 22, 6:27 pm, TreKing <treking...@gmail.com> wrote:
> On Tue, Mar 22, 2011 at 9:35 AM, MobileVisuals <eyv...@astralvisuals.com>wrote:
>
> > how can I include a button like that in the live wallpaper settings GUI?
>
> Include a button in the layout used for the live wallpaper settings GUI ...
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment