3

I'd like to create a PreferenceActivity with a button bar at the bottom, should look like the picture on the right. Anyone know how to do this? I came across this: Bottom button bar in android, but it doesn't work in a Preference screen

enter image description here

Community
  • 1
  • 1
Cbas
  • 6,003
  • 11
  • 56
  • 87

1 Answers1

3

You should be able to create your own layout for the PreferenceActivity that contains your button bar. A PreferenceActivity is just a ListActivity, so follow the rules for creating your own layouts for ListActivity.

Bear in mind that Android 3.0's fragments-based preference screens will not really support this button bar pattern well, and that those buttons will be pointless even in current versions of Android since the preference saving is done automatically.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Sorry for the late response, I've been experimenting with using a ListActivity instead of a PreferenceActivity (as I see know that that picture I posted is a ListActivity), but have decided to stick with the Preference one for various reasons. My problem now is that a button bar has to be contained within a RelativeLayout, but I can't use a RelativeLayout in a PreferenceScreen. Can you think of any other way to do this? – Cbas Apr 01 '11 at 03:36
  • @Cbas: You did not read my answer. Create your own layout for your `PreferenceActivity`. – CommonsWare Apr 01 '11 at 10:54
  • No I definitely did.. I just didn't understand it until I came across this: http://stackoverflow.com/questions/2697233/how-to-add-a-button-to-preferencescreen. Can't believe it didn't come up in my original google searches. Thanks for getting me on the right track – Cbas Apr 02 '11 at 22:19