会发现两者间的区别是因为在编写代码时逻辑没错误的情况下APP一直闪退,经过一次次排查将问题锁定在ID的使用上——也就是Android@id和@+id
其中@+id是定义一个新增的ID属性,而@Android:id是引入已有id,例子如下:
<EditText
android:id="@+id/etContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:gravity="top" />
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="2" >
</ListView>