From 3159c4dfdeddd386fb7af586b44c4fd03894550b Mon Sep 17 00:00:00 2001 From: Stefan Niedermann Date: Fri, 16 Oct 2020 11:44:43 +0200 Subject: [PATCH] Fix build --- .../it/niedermann/owncloud/notes/main/MainActivity.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java index 0c9bc569..2e86d64f 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java @@ -26,7 +26,6 @@ import androidx.core.graphics.drawable.DrawableCompat; import androidx.core.view.GravityCompat; import androidx.core.view.ViewCompat; import androidx.lifecycle.LiveData; -import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -750,7 +749,7 @@ public class MainActivity extends LockedActivity implements NoteClickListener, A @Override public void onAccountDeleted(Account localAccount) { - LiveData deleteLiveData = db.deleteAccount(localAccount); + final LiveData deleteLiveData = db.deleteAccount(localAccount); deleteLiveData.observe(this, (v) -> { if (localAccount.getId() == this.localAccount.getId()) { List remainingAccounts = db.getAccountDao().getAccounts(); @@ -776,10 +775,7 @@ public class MainActivity extends LockedActivity implements NoteClickListener, A @Override public void onCategoryChosen(String category) { for (Integer i : new ArrayList<>(adapter.getSelected())) { - NoteWithCategory note = (NoteWithCategory) adapter.getItem(i); - db.setCategory(ssoAccount, localAccount.getId(), note.getId(), category); + db.setCategory(ssoAccount, localAccount.getId(), ((NoteWithCategory) adapter.getItem(i)).getId(), category); } - - mActionMode.finish(); } }