I am having a problem while parsing XML file,i used newsRSS parser as a reference.but i am getting this error in the real device.how to display an error message like alert for the user and let him stay on the app without crashing?
this is the peace of the code that do the connection and parsing:
protected Config_Parser(String feedUrlString,Context context){
this.context = context;
try {
this.feedUrl = new URL(feedUrlString);
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
protected InputStream getInputStream() {
try {
return feedUrl.openConnection().getInputStream();
} catch (IOException e) {
Log.e("Error", "error happned");
return null;
//throw new RuntimeException(e);
}
}
how may i handle this error with sending alert to the user without crashing or exiting the application?
Thanks for help :)