Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create one Preference with an EditTextPreference and a Togglebutton?

Tags:

What I'm trying to implement is basically and exact replica of the image below (the preferences that I've squared). Pressing anything to the left of the preference should open up a dialog. Pressing the togglebutton will disable/enable whatever I'm setting in this preference.

I've been trying for hours now and I've come up empty-handed. How do I implement this in a PreferenceActivity?

Preference

EDIT: It seems people are misunderstanding my question. It is very important that I figure out how to solve my problem using a PreferenceActivity. NOT an Activity. I don't care whether I need to do it in XML or programatically. Just please refrain from providing me with answers that I cannot use within a or something similar.

EDIT 2 : Added a bounty - I really need an answer to this