“Could not find a method .. in the activity class .. for onClick handler”

后端 未结 3 1337
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 00:43

I am working on my first android project. I am using the thinkgear api. I have two activities. I have an intent in the first activity calling to start the second activity. I

3条回答
  •  猫巷女王i
    2020-12-12 01:26

    Woah format that log or something in the future. Your problem is

    Could not find a method play(View) in the activity class com.example.mindwave1.SecondPageActivity for onClick handler on view class android.widget.Button with id 'button1' 04-16 16:39:51.676: E/AndroidRuntime(13927):

    You probably have a function "play" defined on the onclick xml attribute. This function passes in the view as well, so your method signature needs to look like

    public void play(View view){
    ... 
    }
    

提交回复
热议问题