title: Cannot use timepicker in custom dialog in preference
body: <p>As I want to customize my own timepicker dialog, i do not use the provided timepickerdialog. However I found that it is not work if i call the dialog in preference. But it is work if i put it in a normal xml layout. The code has no error checked by eclipse, but if I run in phone, nullpointerexception comes out start from the bold line below.</p>
  
  <pre><code>public class Prefs extends PreferenceActivity{
  
      Preference time;
  
      void openCustomDialog() {
          AlertDialog.Builder customDialog = new AlertDialog.Builder(Prefs.this);
          customDialog.setTitle("Set Delay Time");
          LayoutInflater layoutInflater = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          View view = layoutInflater.inflate(R.layout.timepicker, null); 
          TimePicker minute = (TimePicker) findViewById(R.id.mPicker);
          **minute.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener()** {
              public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
              }
          });
          minute.setCurrentMinute(usb.minute);
  
          TimePicker second = (TimePicker) findViewById(R.id.sPicker);
          second.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener() {
              public void onTimeChanged(TimePicker view, int hourOfDay, int second) {
              }
          });
          second.setCurrentMinute(usb.second);
          customDialog.setPositiveButton("OK",new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface arg0, int arg1) {
                      }
                  });
          customDialog.setView(view);
          customDialog.show();
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          addPreferencesFromResource(R.xml.prefs);
  
          time = (Preference)findPreference("time");
  
          time.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
              @Override
              public boolean onPreferenceClick(Preference arg0) { 
                  openCustomDialog();  
                  return true;
              }
          });
  }
  </code></pre>