Fix history bug

pull/21/head
FongMi 4 years ago
parent 11192267ed
commit 04b30d5adf
  1. 6
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/DetailActivity.java

@ -300,8 +300,10 @@ public class DetailActivity extends BaseActivity implements KeyDown.Listener {
private void updateHistory() {
History history = AppDatabase.get().getHistoryDao().find(getHistoryKey());
history.setDuration(Players.get().getCurrentPosition());
AppDatabase.get().getHistoryDao().update(history);
if (history != null) {
history.setDuration(Players.get().getCurrentPosition());
AppDatabase.get().getHistoryDao().update(history);
}
}
@Subscribe(threadMode = ThreadMode.MAIN)

Loading…
Cancel
Save