I'm not sure what the problem is. The reason the b.setOnClickListener() line works in the code you posted is exactly what I said- it's inside another method, onCreate(). Your problem was that you...
Type: Posts; User: KevinWorkman
I'm not sure what the problem is. The reason the b.setOnClickListener() line works in the code you posted is exactly what I said- it's inside another method, onCreate(). Your problem was that you...
I'm referring to the entire block that begins with record.setOnClickListener(. You can't call a method at the class level like that. Put that inside another method, possibly a constructor.
...
You can't call methods at the top of your class like that. You can only initialize variables. To call a method, you have to be in a valid method block.
Even if you could, you're missing a closing...