Assume, I have a subclass of EditTextPreference called PasswordProtectedEditTextPreference. This subclass basically shows a password dialog before one can edit
Usually, that means that you do not have an appropriate constructor. Make sure that your constructor is public and takes a Context and AttributeSet as parameters:
public TimePreference(Context ctxt, AttributeSet attrs)
(from this custom preference from this sample project)