如何修复“ java.lang.RuntimeException:无法调用无参数的私有java.util.Objects()”?

时间:2019-07-11 04:07:12

标签: kotlin gson

我正在尝试使用gson解析创建RSS阅读器,但是行<StackPanel Margin="5,5,5,5"> <Label Content = "lblExample" Width = "70" Padding="0" HorizontalAlignment="Left"/> <TextBox Name = "txtExample" Text = "Example Text" HorizontalContentAlignment="Stretch"/> </StackPanel> 遇到问题。引发错误:

  

java.lang.RuntimeException:无法调用没有参数的私有java.util.Objects()

Gson().fromJson

这是我的成绩:

var rssObject= RootObject()

//here is the line where I've got the problem          
rssObject = Gson().fromJson<RootObject>(result, RootObject::class.java)
val adapter = FeedAdapter(rssObject,baseContext)
recyclerView.adapter=adapter
adapter.notifyDataSetChanged()

我正在使用带有空构造函数的数据类

override fun doInBackground(vararg params: String): String {
    val result: String
    val http= HTTPDataHandler()
    result = http.GetHTTPDataHandler(params[0])
    return result
}

0 个答案:

没有答案