if (itemId == R.id.weather_menu_settings) {
intent = new Intent("name.gumartinm.weather.information.WEATHERINFO")
.setComponent(new ComponentName("name.gumartinm.weather.information",
- "name.gumartinm.weather.information.activity.WeatherInformationPreferencesActivity"));
+ "name.gumartinm.weather.information.activity.PreferencesActivity"));
this.startActivity(intent);
return true;
} else if (itemId == R.id.weather_menu_map) {
// 2. Update forecast tab text.
final SharedPreferences sharedPreferences = PreferenceManager
- .getDefaultSharedPreferences(this);
+ .getDefaultSharedPreferences(this.getApplicationContext());
final String keyPreference = this.getString(R.string.weather_preferences_day_forecast_key);
final String value = sharedPreferences.getString(keyPreference, "");
String humanValue = "";
if (value.equals("5")) {
- humanValue = "5 DAY FORECAST";
+ humanValue = this.getString(R.string.text_tab_five_days_forecast);
} else if (value.equals("10")) {
- humanValue = "10 DAY FORECAST";
+ humanValue = this.getString(R.string.text_tab_ten_days_forecast);
} else if (value.equals("14")) {
- humanValue = "14 DAY FORECAST";
+ humanValue = this.getString(R.string.text_tab_fourteen_days_forecast);
}
actionBar.getTabAt(1).setText(humanValue);
}
<string name="app_name">Weather Information</string>
<string name="icon_weather_description">Icon weather</string>
- <!-- Activities Current, Overview and Specific -->
+ <!-- Activities Current, Overview and Specific< -->
+ <string name="text_tab_five_days_forecast">5 DAY FORECAST</string>
+ <string name="text_tab_ten_days_forecast">10 DAY FORECAST</string>
+ <string name="text_tab_fourteen_days_forecast">14 DAY FORECAST</string>
<string name="text_field_sun_rise">SUN RISE</string>
<string name="text_field_sun_set">SUN SET</string>
<string name="text_field_feels_like">FEELS LIKE</string>