Home:ALL Converter>How to compare the caught exception against standard exceptions in asynchronous task android?

How to compare the caught exception against standard exceptions in asynchronous task android?

Ask Time:2011-08-27T15:16:05         Author:Sandeep

Json Formatter

I am a beginner in both java and android. I am using asynchronous task in my project to fetch some data from a web service, faced some problems in exception handling. I referred this SO question and I am following the pattern suggested by CommonsWare in this link.

I succeeded in catching the exceptions and storing it in an exception variable. I need to compare the caught exception against some standard exceptions in onPostExecute method also I would like to display custom error messages based on that. How can I compare this caught exception against standard exceptions? Any help would be appreciated. Thank you.

Author:Sandeep,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/7213073/how-to-compare-the-caught-exception-against-standard-exceptions-in-asynchronous
yy