void acctSelected(ServiceAcctInfo info) { Account acct = new Account(); acct.name = info.desc; acct.service = info; DialogInterface.OnClickListener emptyClickListener = new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) {} }; AcctTables db = new AcctTables(this); try { db.openWritable(); try { db.pushAccount(acct); } catch (SQLiteException e) { AlertDialog dlg = Utilities.buildAlert( this, e, "Unable to add account", "Internal Error", emptyClickListener); dlg.show(); return; } } finally { db.close(); } Intent i = getIntent(); i.putExtra("acct_id", acct.ID); setResult(RESULT_OK, i); finish(); }