improve: setup chooser

This commit is contained in:
imkiva 2018-09-11 09:58:56 +08:00
parent 5a3e87fb2d
commit dede488f81
No known key found for this signature in database
GPG Key ID: A0A40A816B1689AA

View File

@ -134,10 +134,10 @@ class SetupActivity : AppCompatActivity(), View.OnClickListener, ResultListener
R.id.setup_method_backup,
R.id.setup_method_local -> {
val intent = Intent(Intent.ACTION_GET_CONTENT)
intent.addCategory(Intent.CATEGORY_OPENABLE)
intent.type = "*/*";
intent.type = "*/*"
try {
startActivityForResult(intent, REQUEST_SELECT_PARAMETER)
startActivityForResult( Intent.createChooser(intent, getString(R.string.setup_local)),
REQUEST_SELECT_PARAMETER)
} catch (ignore: ActivityNotFoundException) {
Toast.makeText(this, R.string.no_file_picker, Toast.LENGTH_SHORT).show()
}