Java tutorial
//package com.java2s; //License from project: Apache License import android.app.ProgressDialog; import android.content.Context; public class Main { public static ProgressDialog getCustomProgressDialog(Context context, String content, boolean canceledOnTouchOutside, int dialogTheam) { ProgressDialog progressDialog = dialogTheam == 0 ? new ProgressDialog(context) : new ProgressDialog(context, dialogTheam); progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); progressDialog.setMessage(content); progressDialog.setIndeterminate(true); progressDialog.setCanceledOnTouchOutside(canceledOnTouchOutside); return progressDialog; } public static ProgressDialog getCustomProgressDialog(Context context, String content) { return getCustomProgressDialog(context, content, false, 0); } public static ProgressDialog getCustomProgressDialog(Context context, String content, int dialogTheam) { return getCustomProgressDialog(context, content, false, dialogTheam); } }