Created
July 5, 2017 21:54
-
-
Save tommybuonomo/d899993a9e6c88984a72023c329cb6b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpURLConnection urlConnection = null; | |
try { | |
URL url = new URL("https://www.android.com/"); | |
urlConnection = (HttpURLConnection) url.openConnection(); | |
return readInputStream(urlConnection.getInputStream()); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} finally { | |
if (urlConnection != null) { | |
urlConnection.disconnect(); | |
} | |
} | |
return null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment