Я написал следующий код для отображения списка параметров общего доступа, но в OS 10 он показывает не все параметры.
val chooserIntent: Intent
val resources = context.resources
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1) {
if (!intentList.isEmpty()) {
chooserIntent = Intent.createChooser(intentList[0], resources.getString(R.string.Common_Share_Header))
intentList.removeAt(0)
} else {
chooserIntent = Intent.createChooser(emailIntent, resources.getString(R.string.Common_Share_Header))
}
} else {
chooserIntent = Intent.createChooser(Intent(), resources.getString(R.string.Common_Share_Header))
}
// convert intentList to array
val intentListSize = intentList.size
if (intentListSize > 0) {
val extraIntents = intentList.toTypedArray()
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, extraIntents)
}
startActivity(chooserIntent)
Этот код не отображает все параметры общего доступа в ОС 10