diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index c3faa6f..6fd5916 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/app/build.gradle b/app/build.gradle index 8dcaac2..8e522dd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,8 +14,8 @@ android { applicationId "com.log28" minSdkVersion 15 targetSdkVersion 27 - versionCode 10 - versionName "0.6.0" + versionCode 11 + versionName "0.6.1" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true } diff --git a/app/src/main/java/com/log28/Database.kt b/app/src/main/java/com/log28/Database.kt index 1338393..f357c0b 100644 --- a/app/src/main/java/com/log28/Database.kt +++ b/app/src/main/java/com/log28/Database.kt @@ -152,19 +152,20 @@ fun initializeRealm(context: Context) { fun insertAppetite(context: Context) { Log.d(TAG, "Insert appetite called") val realm = Realm.getDefaultInstance() - val appetite = context.resources.getStringArray(R.array.categories).get(4) + val appetite = context.resources.getStringArray(R.array.categories)[4] val appetiteSymptoms = context.resources.getStringArray(R.array.appetite) realm.executeTransactionAsync { localRealm -> - val appetiteCategory = Category(appetite, true) - localRealm.copyToRealm(appetiteCategory) + var appetiteCategory = Category(appetite, true) + appetiteCategory = localRealm.copyToRealm(appetiteCategory) appetiteSymptoms.forEach { val symptom = Symptom(it, appetiteCategory, true) localRealm.copyToRealm(symptom) } } + realm.close() } fun exportDBToLocation(location: File): String {