Reputation: 25
How do I make like this
When the user clicks to save the file an intent will get activated and tell the user where he wants to save that file
Upvotes: 1
Views: 520
Reputation: 3873
There is Storage Access Framework to do exactly this. There is a pretty good description in the Official documentation, so I just provide the simplest sample right here:
const val CREATE_FILE = 1
val intent = Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
addCategory(Intent.CATEGORY_OPENABLE)
}
startActivityForResult(intent, CREATE_FILE)
Upvotes: 1