@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { Long id = getArguments().getLong(ARG_CELL_ID); cell = CellDB.load(CellDB.class, id); if ((numberCell = cell.sliderCell()) == null) { numberCell = new SliderCellDB(); numberCell.setCell(cell); numberCell.save(); } } }
public static CellSliderConfigFragment newInstance(CellDB cell) { CellSliderConfigFragment fragment = new CellSliderConfigFragment(); Bundle args = new Bundle(); args.putLong(ARG_CELL_ID, cell.getId()); fragment.setArguments(args); return fragment; }