예제 #1
0
  @Override
  public void onClick(View v) {
    sc.addSelectedToDatabase(getContext().getApplicationContext());

    ComputationsFragment computationsFragment = new ComputationsFragment();
    getActivity()
        .getSupportFragmentManager()
        .beginTransaction() // TODO fix animation
        .setCustomAnimations(R.anim.fade_in, R.anim.exit_to_right)
        .replace(R.id.fragment_container, computationsFragment)
        .commit();
  }
예제 #2
0
  public void addSelectedToDatabase(Context context) {
    List<Computation> selected = SetupCompsFragment.getSelectedComps();

    TworkDBHelper db = TworkDBHelper.getHelper(context);

    for (Computation comp : selected) {
      db.addComputation(
          comp.getId(),
          comp.getName(),
          comp.getDescription(),
          comp.getTopics(),
          TworkDBHelper.COMP_STATUS_ACTIVE);
      Log.i("SQLite", "added" + comp.getName());
    }
  }
예제 #3
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    sc.populateList(getContext(), getView());
  }