So you basically do (Pseudocode)
ProgessDialog pd = new ProgressDialog(this).show(); Sax.parseStuff(); pd.dismiss();
In this case, wrap the parsing material and cancel the "Exception" dialog
ProgessDialog pd = new ProgressDialog(this).show(); try { Sax.parseStuff(); } finally { pd.dismiss(); // or cancel }
You can also do try { .. } catch (XYZException e ; pd.cancel(); throw e) if you want to handle Exception at a different level in your application.
source share