Exemple #1
0
        private void locationButton_Click(object sender, EventArgs e)
        {
            string enteredlocation = locationInput.Text;

            weatherInformation.getWeatherInformation(enteredlocation);

            Intent intent = new Intent(this, typeof(WeatherDisplay));

            if (weatherInformation.weather != null && weatherInformation.temperature != null && enteredlocation != "")
            {
                intent.PutExtra("homeCity", enteredlocation);
                intent.PutExtra("weather", weatherInformation.weather);
                intent.PutExtra("temperature", weatherInformation.temperature);
            }
            else
            {
                intent.PutExtra("weather", "Location not recognised.\nPlease try again.");
            }

            StartActivity(intent);
        }