Peter Mandeljc
07/08/2021, 7:00 PMclass SelectFileUseCase @Inject constructor(
@ApplicationContext private val context: Context
) {
operator fun invoke(): Uri {
val intent = Intent().apply {
type = "file/*"
action = Intent.ACTION_GET_CONTENT
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
context.startActivity(intent)
// how to get result??
context.registerReceiver(receiver, filter) // maybe?
}
}
Adam Powell
07/08/2021, 7:04 PMPeter Mandeljc
07/08/2021, 7:07 PMIan Lake
07/08/2021, 8:40 PMActivityResultRegistry
class and its methods: https://developer.android.com/training/basics/intents/result#separateIan Lake
07/08/2021, 8:40 PMActivityResultRegistry
at some point)