If the "piece of code" throws the exception you want - then you must
simply catch it - and then display the result:
String err;
bollean error_set;
try{
error_set=false;
//piece of code
}catch(UnknowHostException uh){
err=new String(uh.getMessage());
error_set=true;
// now if err is set - you display it
}
On Jul 26, 4:50 pm, TreKing <[email protected]> wrote:
> On Fri, Jul 22, 2011 at 8:15 AM, dcharlie <[email protected]> wrote:
> > I have this peice of code that throws an UnknowHostException when the host
> > is not found.
> > How can I handle this to send a message to the screen that the host
> > is currently unavailable.
>
> Are you looking for something more elaborate then "catch the exception" ?
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en