示例#1
0
 private void updateWeather() {
   SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
   String location =
       prefs.getString(
           getString(R.string.pref_location_key), getString(R.string.pref_default_value));
   FetchWeatherTask fetcher = new FetchWeatherTask();
   fetcher.execute(location);
 }