/** 操作view更新UI */ public void loadUser(int id) { UserBean user = mUserModel.load(id); // 通过调用IUserView的方法来更新显示 mUserView.setFirstName(user.getmFirstName()); mUserView.setLastName(user.getmLastName()); }
/** 操作model处理数据 */ public void saveData(int id, String firstName, String lastName) { mUserModel.setID(id); mUserModel.setFirstName(firstName); mUserModel.setLastName(lastName); mUserView.cleanAll(); }