private void fetchandshow() { Cursor data_db = recruiters_db.fetch_all(); Log.d("fetch and show", "recruiters"); startManagingCursor(data_db); String[] from = new String[] { Recruiters_db.identity, Recruiters_db.grade, Recruiters_db.rec_name, Recruiters_db.date, Recruiters_db.branches_be, Recruiters_db.pkg_be, Recruiters_db.cutoff_be, Recruiters_db.branches_me, Recruiters_db.pkg_me, Recruiters_db.cutoff_me, Recruiters_db.branches_intern, Recruiters_db.pkg_intern, Recruiters_db.cutoff_intern }; int[] to = new int[] { R.id.rec_name, R.id.date_rec, R.id.branches_be, R.id.branches_me, R.id.branches_intern }; if (data_db.getCount() > 0) { Log.d("YEAH the count is grater than 0", "Fetch and show"); data_db.moveToFirst(); last_recruiter = data_db.getInt(data_db.getColumnIndex("identity")); } data_db.moveToFirst(); Log.d("ID OF LAST ANNOUNCEMENT IS : ", new Integer(last_recruiter).toString()); progress_bar.setVisibility(View.INVISIBLE); MyCustomRecruitCursor adapter = new MyCustomRecruitCursor(this, R.layout.row_recruiter, data_db, from, to); setListAdapter(adapter); Log.d("back to save to db", "recriters"); }
private void save_to_db() { recruiters_db = new Recruiters_db(this, recruiters_list); recruiters_db.add_new_to_db(); fetchandshow(); }