Back to project page UK-Weather-repo.
The source code is released under:
Apache License
If you think the Android project UK-Weather-repo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.haringeymobile.ukweather; //w w w . j ava 2s.c o m import android.os.Bundle; import com.google.gson.Gson; import com.haringeymobile.ukweather.data.objects.CityCurrentWeather; import com.haringeymobile.ukweather.data.objects.WeatherInformation; /** A fragment displaying current weather information. */ public class WeatherCurrentInfoFragment extends WeatherInfoFragment { @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); Bundle args = getArguments(); String jsonString = args.getString(WeatherInfoFragment.JSON_STRING); Gson gson = new Gson(); CityCurrentWeather cityCurrentWeather = gson.fromJson(jsonString, CityCurrentWeather.class); displayWeather(cityCurrentWeather); } @Override protected void displayExtraInfo(WeatherInformation weatherInformation) { CityCurrentWeather cityCurrentWeather = (CityCurrentWeather) weatherInformation; extraInfoTextView.setText(cityCurrentWeather.getCityName()); } }