android - 在包 'onclick' 中找不到属性 'android' 的资源标识符

标签 android

<分区>

这是我的第一个应用程序,请帮助我修复此代码。按钮设置不起作用

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >

<Button
    android:id="@+id/button1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:onclick='buttonBtn'
    ></Button>

最佳答案

将此更改为

 android:onclick='buttonBtn'

 android:onClick='buttonBtn'

c是资本不小

由于 Android 的 XML 解析器区分大小写

关于android - 在包 'onclick' 中找不到属性 'android' 的资源标识符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18932602/

相关文章:

android - 内存不足错误 : backgroud drawable - Android

android - requestLocationUpdates minTime 参数用途

java - 以编程方式创建图层列表

java - 如何在 addProximityAlert 方法中使用 LocationManager.KEY_PROXIMITY_ENTERING 添加 boolean 额外值?

android - 如何从 PhoneGap/Cordova 应用程序直接导航到 Google Play 商店中的应用程序?

Android - 我的应用程序没有连接。如何调试?

c# - 多平台2D游戏引擎

java - 如何在RelativeLayout中固定Textview的位置

android - 启动服务时 bindService() 和 onBind() 之间的延迟

java - 在API中使用静态工厂方法