diff --git a/app/src/main/java/org/foxarmy/barcodescannerforemployees/activities/MainActivity.kt b/app/src/main/java/org/foxarmy/barcodescannerforemployees/activities/MainActivity.kt index f315103..0d04402 100644 --- a/app/src/main/java/org/foxarmy/barcodescannerforemployees/activities/MainActivity.kt +++ b/app/src/main/java/org/foxarmy/barcodescannerforemployees/activities/MainActivity.kt @@ -332,6 +332,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte adapter.addFragment(CategoriesFragment(), getString(R.string.categories_title)) viewpager.adapter = adapter + viewpager.offscreenPageLimit = 3 } override fun onCreateOptionsMenu(menu: Menu): Boolean { diff --git a/app/src/main/java/org/foxarmy/barcodescannerforemployees/fragments/CategoriesFragment.kt b/app/src/main/java/org/foxarmy/barcodescannerforemployees/fragments/CategoriesFragment.kt index d3165ab..4c50226 100644 --- a/app/src/main/java/org/foxarmy/barcodescannerforemployees/fragments/CategoriesFragment.kt +++ b/app/src/main/java/org/foxarmy/barcodescannerforemployees/fragments/CategoriesFragment.kt @@ -35,7 +35,7 @@ class CategoriesFragment : Fragment() { } private fun prepareDatabaseConnection() { - val dbHelper = DBStorageController(requireContext(), sharedPreferences.getString("currentGroup", "database")!!) + val dbHelper = DBStorageController(requireContext(), sharedPreferences.getString("currentGroup", "offline")!!) categoryDAO = CategoryDAO(dbHelper) }