private void submitSolve() { try { List<ManyBook> books = mHelper.getManyBookDao().queryForAll(); for (int i = 0; i < books.size(); i++) { if (positions[i] != 0) { ManyBook book = books.get(i); book.setSolve(true); mHelper.getManyBookDao().update(book); } } finish(); } catch (Exception e) { e.printStackTrace(); } }
private void setData() { positions = getIntent().getIntArrayExtra("positions"); mHelper = DatabaseHelper.getHelper(this); title_middle.setText("均摊"); title_right.setVisibility(View.GONE); solvedList = new ArrayList<Integer>(); try { books = mHelper.getManyBookDao().queryForAll(); } catch (SQLException e) { books = new ArrayList<ManyBook>(); e.printStackTrace(); } }