package com.fsck.k9.fragment; import android.app.Dialog; import android.app.ProgressDialog; import android.os.Bundle; import com.actionbarsherlock.app.SherlockDialogFragment; public class ProgressDialogFragment extends SherlockDialogFragment { private static final String ARG_TITLE = "title"; public static ProgressDialogFragment newInstance(String title) { ProgressDialogFragment fragment = new ProgressDialogFragment(); Bundle args = new Bundle(); args.putString(ARG_TITLE, title); fragment.setArguments(args); return fragment; } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { Bundle args = getArguments(); String title = args.getString(ARG_TITLE); ProgressDialog dialog = new ProgressDialog(getActivity()); dialog.setIndeterminate(true); dialog.setTitle(title); return dialog; } }