title: Custom ListPreference with dynamic entries
body: <p>I need dynamic entries in ListPreference so I can not use conventional way of XML setup of which there are tons of materials online. So far I have following setup as you can see bellow. Problem is that when I run this I see dialog with title and message but no entries are showed even though I know that entries and values are not empty (I know that my entries and values are same but I would get error if I didn't supplied entries)</p>
  
  <pre><code>
  my.preference.DynamicPreference
              android:title="@string/date_format"
              android:dialogMessage="@string/profile_info_date_format"
              android:entryValues="@array/date_format_values"
              android:entries="@array/date_format_values"
  
  </code></pre>
  
  <pre><code>public class DynamicPreference extends ListPreference {
      private int index;
  
      public DynamicPreference(Context context, AttributeSet attrs) {
          super(context, attrs);
      }
  
      public DynamicPreference(Context context) {
          super(context);
      }
  
      @Override
      protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
          builder.setTitle(getTitle());
          builder.setMessage(getDialogMessage());
          builder.setSingleChoiceItems(entries(), -1, new DialogInterface.OnClickListener() {
              @Override
              public void onClick(DialogInterface dialogInterface, int i) {
  
              }
          });
          super.onPrepareDialogBuilder(builder);
      }
  
      @Override
      public void setEntries(CharSequence[] sequence) {
          CharSequence[] entries = listObjects().toArray(new CharSequence[listObjects().size()]);
          super.setEntries(entries);
      }
  
      @Override
      public void setEntryValues(CharSequence[] sequence) {
          CharSequence[] values = getContext().getResources().getStringArray(R.string.date_format);
          super.setEntryValues(values);
      }
  }</code></pre>