Commit 894325ec authored by fengruiyu's avatar fengruiyu

修改问题首次推荐的问题

parent 4fb3c46b
......@@ -19,6 +19,7 @@ import com.mints.street.webview.MintsWebViewActivity
import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.base.BaseViewModel
import me.goldze.mvvmhabit.utils.KLog
import me.goldze.mvvmhabit.utils.SPUtils
import me.tatarka.bindingcollectionadapter2.ItemBinding
import java.io.BufferedReader
import java.io.InputStreamReader
......@@ -116,8 +117,11 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
while (bf.readLine().also { line = it } != null) {
stringBuilder.append(line)
}
mapbeanData.value = Gson().fromJson(stringBuilder.toString(), MapBean::class.java)
mapBean = Gson().fromJson(stringBuilder.toString(), MapBean::class.java)
if ( SPUtils.getInstance().decodeBoolean(HomeFragment.IS_FIRST_OPEN,true)){
mapbeanData.value = Gson().fromJson(stringBuilder.toString(), MapBean::class.java)
SPUtils.getInstance().encode(HomeFragment.IS_FIRST_OPEN,false)
}
} catch (e: Exception) {
KLog.e("读取assets文件下的json出问题")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment