Skip to content

Commit 7dfb9a2

Browse files
Return chooser intent from prepareShareIntent
1 parent 91e9721 commit 7dfb9a2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/src/main/kotlin/com/d4rk/cleaner/app/apps/manager/data/AppPackageManagerImpl.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ class AppPackageManagerImpl(private val application: Application) : ApkInstaller
5656
)
5757
shareIntent.putExtra(Intent.EXTRA_STREAM, contentUri)
5858
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
59-
Intent.createChooser(shareIntent, null)
60-
}.onSuccess { intent: Intent ->
61-
emit(value = DataState.Success(data = intent))
59+
val chooserIntent = Intent.createChooser(shareIntent, null)
60+
chooserIntent
61+
}.onSuccess { chooserIntent: Intent ->
62+
emit(value = DataState.Success(data = chooserIntent))
6263
}.onFailure { throwable ->
6364
emit(value = DataState.Error(error = throwable.toError(default = Errors.UseCase.FAILED_TO_SHARE_APK)))
6465
}

0 commit comments

Comments
 (0)