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
See the Documentation, in this example sendMessage
method uses:
a View as its only parameter (this will be the View that was clicked).
Your error:
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'
You need to use the View
parameter in your method. The solution:
public void play(View view){
...
}
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){
...
}
Your method
public void play(){
is missing the parameter
public void play(View v){