/**
  * @param selectedIndex
  * @return
  */
 public static final SelectGroupingDialogFragment newInstance(int selectedIndex) {
   SelectGroupingDialogFragment dialogFragment = new SelectGroupingDialogFragment();
   Bundle args = new Bundle();
   args.putInt(KEY_SELECTED_INDEX, selectedIndex);
   dialogFragment.setArguments(args);
   return dialogFragment;
 }
Exemplo n.º 2
0
 @Override
 public boolean dispatchCommand(int command, Object tag) {
   CategoryList f =
       ((CategoryList) getSupportFragmentManager().findFragmentById(R.id.category_list));
   switch (command) {
     case R.id.CREATE_COMMAND:
       createCat(null);
       return true;
     case R.id.GROUPING_COMMAND:
       SelectGroupingDialogFragment.newInstance(R.id.GROUPING_COMMAND_DO, f.mGrouping.ordinal())
           .show(getSupportFragmentManager(), "SELECT_GROUPING");
       return true;
     case R.id.GROUPING_COMMAND_DO:
       f.setGrouping(Account.Grouping.values()[(Integer) tag]);
       return true;
   }
   return super.dispatchCommand(command, tag);
 }