android 如何从文件管理器中只选择 .aar 文件

How to choose only .aar file from file manager in android

如何在 android

中传递数据以仅显示文件管理器中的 .arr(固件)文件
val intent = Intent()
 intent.type = "*/*"
 intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, false)
 intent.action = Intent.ACTION_GET_CONTENT
 startActivityForResult(Intent.createChooser(intent, "Select Firmware File"),111)

afaik 有 no such mime type for your extensions (not sure aar or arr), so this is not possible. you have to write own file picker or use some common library (e.g. THIS) and filter list with desired file extension (linked lib have addFileSupport method). also be aware of Scoped storage limitations