Example usage for android.app ProgressDialog getButton

List of usage examples for android.app ProgressDialog getButton

Introduction

In this page you can find the example usage for android.app ProgressDialog getButton.

Prototype

public Button getButton(int whichButton) 

Source Link

Document

Gets one of the buttons used in the dialog.

Usage

From source file:tv.loilo.promise.samples.progress.SampleProgressSpinnerDialogFragment.java

@Override
public void onStart() {
    super.onStart();

    final ProgressDialog progressDialog = (ProgressDialog) getDialog();
    progressDialog.getButton(DialogInterface.BUTTON_NEGATIVE).setOnClickListener(new View.OnClickListener() {
        @Override/*  www . j  av a  2 s  .c o  m*/
        public void onClick(View v) {
            PromiseLoader.cancelLoader(getLoaderManager(), LOADER_ID);
        }
    });

}

From source file:tv.loilo.promise.samples.progress.SampleProgressBarDialogFragment.java

@Override
public void onStart() {
    super.onStart();
    mIsStarted = true;//w ww  . j av a2 s. c  om

    final ProgressDialog progressDialog = (ProgressDialog) getDialog();
    progressDialog.getButton(DialogInterface.BUTTON_NEGATIVE).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            ProgressPromiseLoader.cancelLoader(getLoaderManager(), LOADER_ID);
        }
    });

    ProgressPromiseLoader.attachProgressCallback(getLoaderManager(), LOADER_ID, mLoaderCallbacks);
}