show Progress Dialog and set properties - Android User Interface

Android examples for User Interface:ProgressDialog

Description

show Progress Dialog and set properties

Demo Code


//package com.java2s;
import android.app.ProgressDialog;
import android.content.Context;

public class Main {
    public static ProgressDialog showProgress1(Context context,
            CharSequence title, CharSequence message,
            boolean indeterminate, boolean cancelable,
            boolean canceledOnTouchOutside) {
        ProgressDialog dialog = new ProgressDialog(context);
        dialog.setTitle(title);/*from  w w  w  .  j a  va  2  s  . c  o m*/
        dialog.setMessage(message);
        dialog.setIndeterminate(indeterminate);
        dialog.setCancelable(false);
        dialog.setCanceledOnTouchOutside(false);
        //dialog.setOnCancelListener(new AlixOnCancelListener((Activity) context));

        dialog.show();
        return dialog;
    }
}

Related Tutorials