---
title: "warning: found plain 'id' attribute; did you mean the new 'android:id' name?"
author: "Cjch"
date: "2011-06-23T12:59:15Z"
tags: []
categories: ["移动开发"]
slug: "warning-found-plain-id-attribute-did-you-mean-the-new-android-id-name"
draft: false
lastmod: "2011-06-23T12:59:15Z"
id: 1102098
url: "https://cjch.iteye.com/blog/1102098"
---

<ListView id="@id/android:list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView id="@id/android:empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/no_notes"/>

eclipse有warning提示

warning: found plain 'id' attribute; did you mean the new 'android:id' name?
由于jdk版本高于1.5，设置id属性的时候，应为 android:id，而不是id，这样就可以避免了该错误
修改后

<ListView android:id="@id/android:list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="@id/android:empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/no_notes"/>