I am using this code to fetch my changelog from the net.
InputStream content = null;
try {
URL url = new URL("http://dreamhawk.blinkenshell.org/changelog.txt");
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setRequestMethod("GET");
urlConnection.connect();
content = urlConnection.getInputStream();
BufferedReader r = new BufferedReader(new InputStreamReader(content));
StringBuilder total = new StringBuilder();
String line;
String NL = System.getProperty("line.separator");
try {
while ((line = r.readLine()) != null) {
total.append(line + NL);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String page = total.toString();
Dialog dialog = new Dialog(Main.this);
dialog.setContentView(R.layout.custom_dialog);
dialog.setTitle(R.string.changelog);
dialog.setCanceledOnTouchOutside(true);
TextView text = (TextView) dialog.findViewById(R.id.text);
text.setTextSize(13);
text.setText(page);
dialog.show();
} catch (Exception e) {
//handle the exception !
}
This works, on Android 2.3 and below... But since the ICS update, i am getting nothing! No dialog, no response, no nothing! Help! :/