Fixed category filter

This commit is contained in:
leca 2024-11-17 22:37:54 +03:00
parent f18d7ad1e0
commit 37e52b3f2f
2 changed files with 2 additions and 1 deletions

View File

@ -332,6 +332,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
adapter.addFragment(CategoriesFragment(), getString(R.string.categories_title)) adapter.addFragment(CategoriesFragment(), getString(R.string.categories_title))
viewpager.adapter = adapter viewpager.adapter = adapter
viewpager.offscreenPageLimit = 3
} }
override fun onCreateOptionsMenu(menu: Menu): Boolean { override fun onCreateOptionsMenu(menu: Menu): Boolean {

View File

@ -35,7 +35,7 @@ class CategoriesFragment : Fragment() {
} }
private fun prepareDatabaseConnection() { private fun prepareDatabaseConnection() {
val dbHelper = DBStorageController(requireContext(), sharedPreferences.getString("currentGroup", "database")!!) val dbHelper = DBStorageController(requireContext(), sharedPreferences.getString("currentGroup", "offline")!!)
categoryDAO = CategoryDAO(dbHelper) categoryDAO = CategoryDAO(dbHelper)
} }