diff --git a/app/src/main/java/de/apps4ics/mountainnavigation/MainActivity.java b/app/src/main/java/de/apps4ics/mountainnavigation/MainActivity.java index 1f548a4..c95e06b 100644 --- a/app/src/main/java/de/apps4ics/mountainnavigation/MainActivity.java +++ b/app/src/main/java/de/apps4ics/mountainnavigation/MainActivity.java @@ -470,8 +470,19 @@ //InformDialog informWeatherDialog = new InformDialog(title, msg); //informWeatherDialog.show(getFragmentManager(), "Inform Dialog"); + boolean isSevereWeather = isSevereWeather(weather.weather.currentCondition.getWeatherCode().getCode()); Log.d(TAG, title + ": " + msg); - Log.d(TAG, "isSevereWeather? " + isSevereWeather(weather.weather.currentCondition.getWeatherCode().getCode())); + Log.d(TAG, "isSevereWeather? " + isSevereWeather); + if (isSevereWeather) { + String warnMsg = "The waeather around you in " + weather.weather.location.getCity() + " is '" + weather.weather.currentCondition.getWeatherCode().getLabel(getApplicationContext()) + "'!"; + InformDialog informAlertDialog = new InformDialog("Weather Warning!", warnMsg); + informAlertDialog.show(getFragmentManager(), "Inform Dialog - Weather Warning"); + } else { + String noWarnMsg = "The waeather around you in " + weather.weather.location.getCity() + " is '" + weather.weather.currentCondition.getWeatherCode().getLabel(getApplicationContext()) + "'"; + InformDialog informAlertDialog = new InformDialog("No Weather Warning! =)", noWarnMsg); + informAlertDialog.show(getFragmentManager(), "Inform Dialog - No Weather Warning"); + + } } @Override