I port from Java to C # code. There is a fragment:
private void updateWeatherData(final String city) { new Thread() { public void run() { final JSONObject json = WeatherData.getJSONData(getActivity(), city); if (json == null) { _handler.post(new Runnable() { public void run() { Toast.makeText(getActivity(), getActivity().getString(R.string.place_not_found), Toast.LENGTH_LONG).show(); } }); } else { _handler.post(new Runnable() { public void run() { renderWeather(json); } }); } } }.start(); } In C #, a stream cannot contain anything, or rather does not take anything that comes after the declaration. That is, if I write this or something similar in the method:
new thread() The compiler will ask you to close the curly braces, although there is a lot of code further. Can you please tell me how to open a stream in order to continue the code in the method without any problems?