Code example for DialogInterface

Methods: cancel

    public void onClick(DialogInterface dialog, int which) {
        switch (which) {
            case DialogInterface.BUTTON_NEGATIVE:
            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() {
                    public void run() { 
Contextual code suggestions in your IDE  Get Codota for Java