diff --git a/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java b/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java index 6145b6812..e1c1b5ed7 100644 --- a/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java +++ b/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java @@ -55,15 +55,14 @@ public class ApplicationAdapter extends RecyclerView.Adapter { - CheckBox chkbox = (CheckBox) v; - if (chkbox.isChecked()) { + holder.checkBox.setOnCheckedChangeListener(null); + holder.checkBox.setChecked(mHideList.contains(info.packageName)); + holder.checkBox.setOnCheckedChangeListener((v, isChecked) -> { + if (isChecked) { new Async.MagiskHide().add(info.packageName); mHideList.add(info.packageName); - } - else { + } else { new Async.MagiskHide().rm(info.packageName); mHideList.remove(info.packageName); }