【问题标题】:Find view in PlaceHolderView [duplicate]在 PlaceHolderView 中查找视图 [重复]
【发布时间】:2020-02-23 13:25:48
【问题描述】:

我有一个无限占位符视图 (https://github.com/janishar/PlaceHolderView),我的卡片布局看起来像 this 和 java 类 this。字段 imageViewcategory 已解决,但 likes TextView 没有。我得到的异常:`

android.content.res.Resources$NotFoundException: String resource ID #0x0
        at android.content.res.Resources.getText(Resources.java:430)
        at android.content.res.HwResources.getText(HwResources.java:463)
        at android.widget.TextView.setText(TextView.java:6019)
        at io.onhigh.funtech.android.memorld2.ui.feedv2.dto.ContentView.onResolved(ContentView.java:25)

`

【问题讨论】:

  • @Shashanth 是 --------

标签: android android-recyclerview


【解决方案1】:

您的likesint 类型。 Android 认为您指的是资源 ID。它试图查找资源,但没有这样做。一种解决方案是在 int likes 属性上调用 toString()

【讨论】:

  • 是的,你说得对!谢谢你
猜你喜欢
  • 2015-01-19
  • 2013-02-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-06-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多