android:id and id are not same...

来源:互联网 发布:linux与windows区别 编辑:程序博客网 时间:2024/04/29 05:46

You need to be careful when defining the xml elements of layout.

In the layout, mostly I specified the id by "android:id".

When I used "id" mistakenly, "findViewByI()" cannot find the view (e.g., a button) in the OnClickListener's "onClick()" definition (it returned null)!