• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How to add a button to an preference activity

aliov_85

Lurker
Nov 27, 2010
1
0
Hello,

I've an activity as follows:
Code:
public class NewPhysAct extends PreferenceActivity

I use preferences to display a form.

Code:
<PreferenceScreen
  xmlns:android="http://schemas.android.com/apk/res/android">
  <PreferenceCategory
      android:title="New phyisical activity">
  
<ListPreference 
    android:entryValues="@array/typofactvalues"
    android:entries="@array/typofact"
    android:key="typact"
    android:title="Activitytype"
    android:dialogTitle="Type of activity"
    android:defaultValue="0.9"></ListPreference>
</PreferenceCategory>
  <EditTextPreference
      android:key="duration"
      android:title="Duration"
      android:dialogTitle="Choose you activity"
      android:defaultValue="0"
      android:numeric="integer">
  </EditTextPreference>  
</PreferenceScreen>


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

Thanks in advance
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones