1. Introducing Channels - a new way to chat with other Android users!
    Dismiss Notice

How to add a button to an preference activity


Last Updated:

  1. aliov_85

    aliov_85 New Member This Topic's Starter

    Joined:
    Nov 27, 2010
    Messages:
    1
    Likes Received:
    0
    Hello,

    I've an activity as follows:
    Code (Text):
    1. public class NewPhysAct extends PreferenceActivity
    I use preferences to display a form.

    Code (Text):
    1.  
    2. <PreferenceScreen
    3.   xmlns:android="http://schemas.android.com/apk/res/android">
    4.   <PreferenceCategory
    5.       android:title="New phyisical activity">
    6.  
    7. <ListPreference
    8.     android:entryValues="@array/typofactvalues"
    9.     android:entries="@array/typofact"
    10.     android:key="typact"
    11.     android:title="Activitytype"
    12.     android:dialogTitle="Type of activity"
    13.     android:defaultValue="0.9"></ListPreference>
    14. </PreferenceCategory>
    15.   <EditTextPreference
    16.       android:key="duration"
    17.       android:title="Duration"
    18.       android:dialogTitle="Choose you activity"
    19.       android:defaultValue="0"
    20.       android:numeric="integer">
    21.   </EditTextPreference>  
    22. </PreferenceScreen>
    23.  

    How can I add a button like "ok" which I can use to change activity?

    Thanks in advance
     

    Advertisement

Share This Page

Loading...