diff --git a/plukke/build.gradle b/plukke/build.gradle index 1277ae1..e809219 100644 --- a/plukke/build.gradle +++ b/plukke/build.gradle @@ -9,7 +9,7 @@ android { minSdkVersion 16 targetSdkVersion 30 versionCode 1 - versionName "0.6" + versionName "0.7" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -25,5 +25,5 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation "androidx.fragment:fragment-ktx:$fragment_ktx_version" + implementation "androidx.fragment:fragment-ktx:$fragment_ktx_version" //FIXME Not working with next 1.3.0-rc01 } \ No newline at end of file diff --git a/plukke/src/main/java/eu/acolombo/plukke/Plukke.kt b/plukke/src/main/java/eu/acolombo/plukke/Plukke.kt index f04ad98..28b3521 100644 --- a/plukke/src/main/java/eu/acolombo/plukke/Plukke.kt +++ b/plukke/src/main/java/eu/acolombo/plukke/Plukke.kt @@ -18,7 +18,7 @@ import java.io.Closeable class Plukke( private val componentActivity: ComponentActivity, - clearOnDestroy: Boolean = false + clearOnDestroy: Boolean = true ) : LifecycleObserver, Closeable { private class ExternalContent(private val resolver: ContentResolver) : Closeable { @@ -43,8 +43,7 @@ class Plukke( if (result.resultCode == Activity.RESULT_OK) onResult( result?.data?.data ?: photo?.uri ?: exc.close() .run { return@registerForActivityResult } - ) - exc.close() + ) else exc.close() }.launch(listOfNotNull(photo, pick)) }