问题
The thing is...I want to use PreferenceActivity to add a new row in my custom list view. So my preference ativity will consist of a few EditTextPreferences, my custom TimePickerPreference and a coulpe of ListPreferences... Like this: http://www.google.com/help/hc/images/android/android_ug/168567.5.png . The question is how they added buttons on the bottom? And.. is it possible to use OnClickListener for obtaining inputed values and how? Thanks!
回答1:
A PreferenceActivity
inherits from ListActivity
. By default, ListActivity
creates its own ListView
, but you can supply your own layout via setContentView()
, so long as your ListView
in the layout has the right android:id
. Here is the layout for the alarm activity.
来源:https://stackoverflow.com/questions/4725346/android-add-buttons-to-a-preference-screen