Skip to content

Instantly share code, notes, and snippets.

Last active December 20, 2015 07:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save nicolasjafelle/6091872 to your computer and use it in GitHub Desktop.
Save nicolasjafelle/6091872 to your computer and use it in GitHub Desktop.
Helper class that helps you show RoboDialogFragments. You can use it with Roboguice and injected RoboDialogFragments. It is based on the DialogFragmentHelper class of the Github Android app.
* Dialog fragment helper
public abstract class DialogFragmentHelper extends RoboDialogFragment {
private static final String TAG = "dialog_fragment_helper";
* Show dialog
public static void show(FragmentActivity activity, RoboDialogFragment fragment, Bundle arguments) {
FragmentManager manager = activity.getSupportFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
Fragment current = manager.findFragmentByTag(TAG);
if (current != null) {
if(fragment.getArguments() == null) {
}else {
}, TAG);
To use simple inject a RoboDialogFragment and use it:
public class MyRoboFragment extends RoboFragment...
private ProgressDialogFragment progressDialog;
private void createProgressDialog(int resId) {
Bundle arguments = new Bundle();
arguments.putString(ProgressDialogFragment.MESSAGE, getString(resId));, progressDialog, arguments);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment