【问题标题】:why my playClick and stopClick button is never used?为什么我的 playClick 和 stopClick 按钮从未使用过?
【发布时间】:2021-09-06 01:18:24
【问题描述】:

这是我的问题,所以我的活动按钮处理程序声明我的方法从未使用过,但我已经在 XML 上创建了按钮

活动:

XML:

【问题讨论】:

    标签: android android-studio android-button


    【解决方案1】:

    在您的 XML 文件中,将根 LinearLayout 中的 tools:context 更改为您的 Activity 的路径,因为此数据用于绑定 onClick 操作

    从截图中我可以看出,它应该改为

    tools:context=".LanderActivity"
    

    【讨论】:

    • 我已将 tools:context 更改为 tools:context=".LanderActivity" 但还是一样
    猜你喜欢
    • 2013-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-19
    • 2021-05-17
    • 2015-11-10
    • 2011-07-22
    • 2011-06-30
    相关资源
    最近更新 更多