Я использую архитектуру MVVM в своем приложении.Я столкнулся с проблемой, хочу получить подтверждение об успешной операции INSERT @ INSERT в действии из модели представления.
Код ViewModel Souce равен
public void insert(UploadApplicationDbModel uploadApplicationDbModel) {
uploadApplicationRepository.insert(uploadApplicationDbModel);
}
Хранилище Исходный код:
public void insert(UploadApplicationDbModel uploadApplicationDbModel) {
new InsertUploadApplication(applicationDao).execute(uploadApplicationDbModel);
}
private static class InsertUploadApplication extends AsyncTask<UploadApplicationDbModel, Void, Long> {
private UploadApplicationDao uploadApplicationDao;
private InsertUploadApplication(UploadApplicationDao uploadApplicationDao) {
this.uploadApplicationDao = uploadApplicationDao;
}
@Override
protected Long doInBackground(UploadApplicationDbModel... UploadApplicationDbModel) {
return uploadApplicationDao.insert(UploadApplicationDbModel[0]);
}
@Override
protected void onPostExecute(Long aLong) {
super.onPostExecute(aLong);
}
}