@Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
    Log.e("ROMAN", "ACTIVITY RESULT");

    mPicker.onActivityResult(requestCode, resultCode, data);

    super.onActivityResult(requestCode, resultCode, data);
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.prefs_weather);

    prefs = getActivity().getSharedPreferences("weather", Context.MODE_PRIVATE);

    mWeatherSyncInterval = (ListPreference) findPreference("refresh_interval");
    mWeatherSyncInterval.setOnPreferenceChangeListener(this);
    mWeatherSyncInterval.setSummary(
        Integer.toString(WeatherPrefs.getRefreshInterval(mContext)) + " minutes");

    mCustomWeatherLoc = (EditTextPreference) findPreference("custom_location");
    mCustomWeatherLoc.setOnPreferenceChangeListener(this);
    mCustomWeatherLoc.setSummary(WeatherPrefs.getCustomLocation(mContext));

    mEnableWeather = (CheckBoxPreference) findPreference("enable_weather");
    mEnableWeather.setChecked(
        Settings.System.getInt(getContentResolver(), Settings.System.USE_WEATHER, 0) == 1);

    mUseCustomLoc = (CheckBoxPreference) findPreference(WeatherPrefs.KEY_USE_CUSTOM_LOCATION);
    mUseCustomLoc.setChecked(WeatherPrefs.getUseCustomLocation(mContext));

    mShowLoc = (CheckBoxPreference) findPreference("show_location");
    mShowLoc.setChecked(
        Settings.System.getInt(getContentResolver(), Settings.System.WEATHER_SHOW_LOCATION, 0)
            == 1);

    mUseCelcius = (CheckBoxPreference) findPreference(WeatherPrefs.KEY_USE_CELCIUS);
    mUseCelcius.setChecked(WeatherPrefs.getUseCelcius(mContext));

    setHasOptionsMenu(true);

    if (!Settings.Secure.isLocationProviderEnabled(
            getContentResolver(), LocationManager.NETWORK_PROVIDER)
        && !mUseCustomLoc.isChecked()) {
      showDialog(LOC_WARNING);
    }
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    keys.add(Settings.System.LOCKSCREEN_HIDE_NAV);
    keys.add(Settings.System.LOCKSCREEN_LANDSCAPE);
    keys.add(Settings.System.LOCKSCREEN_QUICK_UNLOCK_CONTROL);

    // Load the preferences from an XML resource
    addPreferencesFromResource(R.xml.prefs_lockscreens);

    menuButtonLocation = (CheckBoxPreference) findPreference(PREF_MENU);
    menuButtonLocation.setChecked(
        Settings.System.getInt(
                getActivity().getContentResolver(), Settings.System.LOCKSCREEN_ENABLE_MENU_KEY, 1)
            == 1);

    mLockScreenTimeoutUserOverride = (CheckBoxPreference) findPreference(PREF_USER_OVERRIDE);
    mLockScreenTimeoutUserOverride.setChecked(
        Settings.Secure.getInt(
                getActivity().getContentResolver(),
                Settings.Secure.LOCK_SCREEN_LOCK_USER_OVERRIDE,
                0)
            == 1);

    mLockscreenOption = (ListPreference) findPreference(PREF_LOCKSCREEN_LAYOUT);
    mLockscreenOption.setOnPreferenceChangeListener(this);
    mLockscreenOption.setValue(
        Settings.System.getInt(
                getActivity().getContentResolver(), Settings.System.LOCKSCREEN_LAYOUT, 0)
            + "");

    mLockscreenBattery = (CheckBoxPreference) findPreference(PREF_LOCKSCREEN_BATTERY);
    mLockscreenBattery.setChecked(
        Settings.System.getInt(
                getActivity().getContentResolver(), Settings.System.LOCKSCREEN_BATTERY, 0)
            == 1);

    mVolumeWake = (CheckBoxPreference) findPreference(PREF_VOLUME_WAKE);
    mVolumeWake.setChecked(
        Settings.System.getInt(
                getActivity().getContentResolver(), Settings.System.VOLUME_WAKE_SCREEN, 0)
            == 1);

    mVolumeMusic = (CheckBoxPreference) findPreference(PREF_VOLUME_MUSIC);
    mVolumeMusic.setChecked(
        Settings.System.getInt(
                getActivity().getContentResolver(), Settings.System.VOLUME_MUSIC_CONTROLS, 0)
            == 1);

    mPicker = new ShortcutPickerHelper(this, this);

    for (String key : keys) {
      try {
        ((CheckBoxPreference) findPreference(key))
            .setChecked(Settings.System.getInt(getActivity().getContentResolver(), key) == 1);
      } catch (SettingNotFoundException e) {
      }
    }

    ((PreferenceGroup) findPreference("advanced_cat"))
        .removePreference(findPreference(Settings.System.LOCKSCREEN_HIDE_NAV));

    refreshSettings();
  }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
   inflater.inflate(R.menu.weather, menu);
 }