如何在Android Studio 3.0下的代码.parseList {DayForecast(HashMap(it))}中显示它的值?
下面的示例代码是从https://github.com/antoniolg/Kotlin-for-Android-Developers/blob/master/app/src/main/java/com/antonioleiva/weatherapp/data/db/ForecastDb.kt
我希望在代码中显示“it”的值.parseList{ DayForecast(HashMap(it)) }
所以我在code val dailyForecast ...
之前设置了一个断点val dailyForecast ...
,然后在Android Studio中点击Run – > val dailyForecast ...
menu,按F7开始Step Into,但是我找不到“it”在代码.parseList{ DayForecast(HashMap(it)) }
我能怎么做? 谢谢!
override fun requestForecastByZipCode(zipCode: Long, date: Long) = forecastDbHelper.use { val dailyRequest = "${DayForecastTable.CITY_ID} = ? AND ${DayForecastTable.DATE} >= ?" val dailyForecast = select(DayForecastTable.NAME) .whereSimple(dailyRequest, zipCode.toString(), date.toString()) .parseList { DayForecast(HashMap(it)) } val city = select(CityForecastTable.NAME) .whereSimple("${CityForecastTable.ID} = ?", zipCode.toString()) .parseOpt { CityForecast(HashMap(it), dailyForecast) } city?.let { dataMapper.convertToDomain(it) } }
你可以暂时给它一个名字:
.parseList { val map = it DayForecast(HashMap(it)) }