Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. /*try {
  2. URL url = new URL(API_URL[0]);
  3. URLConnection connection;
  4. connection = url.openConnection();
  5.  
  6. HttpURLConnection httpConnection = (HttpURLConnection) connection;
  7. int responseCode = httpConnection.getResponseCode();
  8. if (responseCode == HttpURLConnection.HTTP_OK) {
  9. InputStream in = httpConnection.getInputStream();
  10. SAXParserFactory spf = SAXParserFactory.newInstance();
  11. SAXParser parser = spf.newSAXParser();
  12. XMLReader xr = parser.getXMLReader();
  13. WeatherParser xmlHandler = new WeatherParser();
  14. xr.setContentHandler(xmlHandler);
  15. xr.parse(new InputSource(in));
  16. trenutnoVremeList = xmlHandler.vremenskiPodatki();
  17. }
  18.  
  19. } catch (Exception e) {
  20. e.printStackTrace();
  21. }
  22. return trenutnoVremeList;
  23. }
  24.  
  25. @Override
  26. protected void onPostExecute(ArrayList<TrenutnoVreme> trenutnoVreme) {
  27. if (lv == null) return;
  28. ArrayAdapter<TrenutnoVreme> adapter = new ArrayAdapter<>(MainActivity.this, android.R.layout.simple_list_item_1, trenutnoVreme);
  29. lv.setAdapter(adapter);
  30. }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement