Program: Register User

When I failed creating an account, and if I want to solve this problem, can I only make some change in “catch". For example, after failing in creating an account, I need to pop up a dialog, but writing code in “catch” to pop up the Dialog is a wrong way. Then how can I know directly that I fail creating the account and why except by the mean of catching exception.

such as the following code:

HashMap hmap = new HashMap();

hmap.put(“email”, emailstr);

AccountManager acount = con.getAccountManager();

try{

acount.createAccount(idstr, pwdstr, hmap);

}catch(XMPPException xe){

xe.printStackTrace();

}

Please give me a specific answer with examples.

Many thanks!

In other people’'s question.