How to add a button to a PreferenceScreen?

后端 未结 10 1284
抹茶落季
抹茶落季 2020-11-28 20:48

I\'m quite new to Android Development and just came across Preferences. I found PreferenceScreen and wanted to create a login functionality with it. The only pr

10条回答
  •  执笔经年
    2020-11-28 21:14

    I don't think there is an easy way to just add a Button to a preference screen. Preferences are limited to:

    EditTextPreference
    ListPreference
    RingtonePreference
    CheckboxPreference
    

    While using a preference screen, you are limited to the use of these options, and there are no single "button-preference" which could be easily used for your need.

    I've been looking for similar functionality, with adding buttons to the preference screen, but it seems like you need to build your own screen for this, managing the change to preferences in your own implementation.

提交回复
热议问题