Skip to content

Instantly share code, notes, and snippets.

@XuNeal
Forked from dhawalhshah/ProgressDialogFragment.java
Last active August 29, 2015 14:14
Show Gist options
  • Save XuNeal/0fe26a9c0d1bac188bad to your computer and use it in GitHub Desktop.
Save XuNeal/0fe26a9c0d1bac188bad to your computer and use it in GitHub Desktop.
public class ProgressDialogFragment extends DialogFragment {
public static LoadingDialogFragment newInstance() {
ProgressDialogFragment frag = new ProgressDialogFragment ();
frag.setCancelable(false);
return frag;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final ProgressDialog dialog = new ProgressDialog(getActivity());
dialog.setMessage(getString(R.string.loading_text));
dialog.setIndeterminate(true);
dialog.setOnKeyListener(keyListener);
return dialog;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment