【发布时间】:2017-12-07 21:59:38
【问题描述】:
我想存储像 < 4.1, 29..35 > 这样的键值对,我可以用 HashMap<Double, Range<Int>> 来做到这一点:
val womanMap: HashMap<Double, Range<Int>> = hashMapOf()
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
fun createMap() {
//This both requires API 21
val range = Range(29,35)
womanMap[4.6] = Range.create(29,35)
}
如何在 API 级别 21 以下执行此操作?
【问题讨论】:
标签: android kotlin android-api-levels