Android studio 如何摆脱“警告”;无法解析符号';id/andr'&引用;对于ExpandableListView“;

Android studio 如何摆脱“警告”;无法解析符号';id/andr'&引用;对于ExpandableListView“;,android-studio,android-studio-3.2,Android Studio,Android Studio 3.2,应用程序使用,ExpandableListView的使用是基于文档的标准: <ExpandableListView android:id="@id/android:list" android:layout_width="match_parent" android:layout_height="0dip" android:layout_weight="1" android:divider="@android:color/transparent"

应用程序使用,ExpandableListView的使用是基于文档的标准:

<ExpandableListView
    android:id="@id/android:list"
    android:layout_width="match_parent"
    android:layout_height="0dip"
    android:layout_weight="1"
    android:divider="@android:color/transparent"
    android:dividerHeight="5dip"
    android:layout_marginTop="10dip">
</ExpandableListView>

Android Studio 3.2有以下警告:

我怎样才能摆脱这个警告?

我不知道是什么(id=“@id/android:list”)

给它一个普通id(@+id/androidlist) 并在代码中处理它

但是如果您学习如何使用ExpandableListView 我更喜欢这个链接教程


GL sir

这可能是一个打字错误。将其更改为:

"@android:id/empty"

另见

ListActivity具有由单个, 屏幕中央的全屏列表。但是如果你愿意的话,, 您可以通过设置自己的视图布局来自定义屏幕布局 在onCreate()中使用setContentView()。要做到这一点,你必须有自己的观点 包含id为“@android:id/list”(或R.id.list)的ListView对象 如果是在代码中)


你好,谢谢你的帮助。该用法是从ExpandableListActivity的官方文档中复制的,如我的原始帖子所示。添加“+”并不能解决问题。到目前为止,ExpandableListActivity一直运行良好,因此我不打算对其进行更改。我只是想摆脱这个警告,谢谢。“@android:id/list”做到了。我不知道如何使用“@android:id/empty”。它应该用于相同的ExpandableListView吗?@Hong
@id/android:list
显然没有有效的语法,所以我会说是的。我在同一个ExpandableListView中添加了@android:id/empty,除了“@android:id/list”,但出现了错误“重复属性id”。@Hong您不能在一个视图中添加两个id。可能我误解了您的答案。“将其更改为:“@android:id/empty”和“@android:id/list”是什么意思?
"@android:id/list"