Skip to content

Instantly share code, notes, and snippets.

@pawelkw
Created November 12, 2013 06:32
Show Gist options
  • Save pawelkw/7426460 to your computer and use it in GitHub Desktop.
Save pawelkw/7426460 to your computer and use it in GitHub Desktop.
public class CalendarActivity extends Activity {
...
protected void onCreate(Bundle savedInstanceState) {
try {
URL url = new URL("http://www.google.com");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
readStream(con.getInputStream());
} catch (Exception e) {
e.printStackTrace();
}
}
private void readStream(InputStream in) {
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment