При попытке получить данные через url вылетает ошибка

Я только-только начинаю переходить к Андроид-разработке, и возникла проблема: при попытке получить данные с сайта погоды вылетает ошибка:
Only the original thread that created a view hierarchy can touch its views
Я знаю, что у меня устаревший способ задания многопоточности, но хочу починить именно эту версию. Ожидаю, что отобразятся данные в json формате. Что я делаю не так?

Код, который есть:

public class MainActivity extends AppCompatActivity {

    private EditText userField;
    private Button mainBtn;
    private TextView resultInfo;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        userField = findViewById(R.id.editText);
        mainBtn = findViewById(R.id.mainButton);
        resultInfo = findViewById(R.id.resultInfo);

        mainBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String city = userField.getText().toString();
                String key = "301ba81282319f09b3";
                String url_s = "https://api.openweathermap.org/data/2.5/weather?q=" + city + "&appid=" + key + "&lang=ru";
                if (userField.getText().toString().trim().equals(""))
                    Toast.makeText(MainActivity.this, R.string.ToastForUser, Toast.LENGTH_SHORT).show();
                else{
                    resultInfo.setText("Загрузка...");
                    new Thread(new Runnable() {
                    @Override
                    public void run() {
                        try{
                            String result = getResult(url_s);
                            resultInfo.setText(result);
                            resultInfo.post(new Runnable() {
                                public void run() {
                                    resultInfo.setText(result);}
                            });
                        }catch ( IOException ex){resultInfo.setText("Ошибка: "+ex.getMessage());}
                    }
                }).start();
                }
            }
        });
    }

    private String getResult(String url_s) throws IOException{
        HttpURLConnection connection = null;
        BufferedReader reader = null;
        InputStream istream = null;
        try {
            URL url = new URL(url_s); // открыли URL соединение
            connection = (HttpsURLConnection)url.openConnection(); 
            connection.connect();
            istream = connection.getInputStream(); 
            reader = new BufferedReader(new InputStreamReader(istream)); 
            StringBuffer buffer = new StringBuffer();
            String line = "";
            while ((line = reader.readLine()) != null) {
                buffer.append(line).append("\n");
            }
            return buffer.toString();
        } catch (MalformedURLException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (connection != null)
                connection.disconnect();
            try {
                if (reader != null)
                    reader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}

Ответы (0 шт):