Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*try {
- URL url = new URL(API_URL[0]);
- URLConnection connection;
- connection = url.openConnection();
- HttpURLConnection httpConnection = (HttpURLConnection) connection;
- int responseCode = httpConnection.getResponseCode();
- if (responseCode == HttpURLConnection.HTTP_OK) {
- InputStream in = httpConnection.getInputStream();
- SAXParserFactory spf = SAXParserFactory.newInstance();
- SAXParser parser = spf.newSAXParser();
- XMLReader xr = parser.getXMLReader();
- WeatherParser xmlHandler = new WeatherParser();
- xr.setContentHandler(xmlHandler);
- xr.parse(new InputSource(in));
- trenutnoVremeList = xmlHandler.vremenskiPodatki();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return trenutnoVremeList;
- }
- @Override
- protected void onPostExecute(ArrayList<TrenutnoVreme> trenutnoVreme) {
- if (lv == null) return;
- ArrayAdapter<TrenutnoVreme> adapter = new ArrayAdapter<>(MainActivity.this, android.R.layout.simple_list_item_1, trenutnoVreme);
- lv.setAdapter(adapter);
- }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement