Code example for DialogInterface

Methods: cancel

0
     */ 
    @Override 
    public void onClick(DialogInterface dialog, int which) {
        switch (which) {
            case DialogInterface.BUTTON_NEGATIVE:
                dialog.cancel();
                break; 
            case DialogInterface.BUTTON_POSITIVE:
                final long accountId = getArguments().getLong("accountId");
                final String text = mQuickResponseEditText.getText().toString();
                final Context context = getActivity();
                if (mQuickResponse == null) {
                    mQuickResponse = new QuickResponse(accountId, text);
                } 
 
                // Insert the new QuickResponse into the database. Content watchers used to 
                // update the ListView of QuickResponses upon insertion. 
                EmailAsyncTask.runAsyncParallel(new Runnable() {
                    @Override 
                    public void run() { 
                        if (!mQuickResponse.isSaved()) {