Code example for PreferenceManager

Methods: findPreference

0
  } 
   
  public void testDefaultDateForBadDate() { 
    DatePreferenceActivity activity = getRestoredActivity();
    PreferenceManager preferenceManager = activity.getPreferenceManager();
    DatePreference datePreference = (DatePreference)preferenceManager.findPreference("doa");
    Calendar defaultDate = datePreference.getDate();
    assertCalendarDateEquals(defaultDate(), defaultDate);
  } 
   
  public void testDateChanged() { 
    DatePreferenceActivity activity = getRestoredActivity();
    assertNotNull(activity);
     
    activateDodPreference(); 
     
    // increment the day 
    sendKeys(KeyEvent.KEYCODE_DPAD_DOWN,
        KeyEvent.KEYCODE_DPAD_UP,
        KeyEvent.KEYCODE_DPAD_RIGHT,
        KeyEvent.KEYCODE_DPAD_UP,