Code example for CancellationException

0
    { 
        Log.e(TAG, "Unable to save ", dialogException);
        mErrorDialogException = dialogException;
        mErrorDialogMessage = dialogErrorMessage;
        cancel(false);
        throw new CancellationException(dialogErrorMessage);
    } 
 
    @Override 
    protected Uri doInBackground(String... params) {
        String url = params[0];
 
        return importStationsFromXMLURL(url);
    } 
 
    @Override 
    protected  void onPreExecute() 
    { 
        mProgressListener.started();
    }