I have a problem. Why a data in setText method are set incorrecetly?
MainActivity class
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textViewCity = (TextView) findViewById(R.id.text_view_city_name);
textViewTemperature = (TextView) findViewById(R.id.text_view_current_temperature);
new Thread(new WeatherYahoo()).start();
Weather weather = new Weather();
textViewCity.setText(weather.getCity());
textViewTemperature.setText(String.valueOf(weather.getTemperature()));
}
Data were downloaded and set correctly in Weather class (I use JSON) but on the screen showed empty string form textViewCity and 0 for textViewTemperature.