您的位置:首页 > 其它

安卓初学者关于在setContentView(..)出现source not found 的问题

2014-06-24 14:43 127 查看
这也是今天遇到的一个问题。对于新手来说,或许也算情有可原!

当我将新代码加入项目进行手机调试时,开始出现source not found 的错误,断点进入调试,发现出居然出现在setContentView(R.layout.sh_query_price);这句代码里。

locat中找到错误:Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.button" on path: DexPathList[dexElements=[zip file "/data/app/com.example.biaochengmobile-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.biaochengmobile-1,
/vendor/lib, /system/lib]]。而下面这一段是我.xml布局文件里的一段代码,

<button

android:id="@+id/button_query"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:background="@drawable/btn_selector_log"

android:layout_marginTop="16dp"

android:text="查询" />

<Button

android:id="@+id/button_reset"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:background="@drawable/btn_selector_log"

android:layout_marginTop="16dp"

android:text="重置" />

很显然,button首字母的小写导致了这个错误,因为默认情况下都是大写的。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐