Im trying to trace a click when my image view is clicked, but I cannot seem to pick up the touch, any ideas?
imgView.setOnClickListener(new View.OnClickListener(){
public void onClick(View v) {
Log.v(TAG, " click");
}
});
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Images normally aren’t clickable, therefore I would suggest that you put the definition
in your layout.xml to the imageView.
If this is not helping, please edit+update your question and show us the part of your layout, where you define the image to have a look at it.
EDIT:
Tried it, and your code worked with me too – even with the upper case id name.
Can you please have a close look at your LogCat?
Mine sometimes doesn’t really update, as long as I don’t choose the device again.
To do so in Eclipse, go to the View “Devices” (or show it first via “Window”) and click once on your device / virtual device.
If you still don’t find your log entry in the LogCat-View, try to create a filter (via the green plus and giving it the String you defined with
TAGas “by Log Tag”).Have a look at android developers > Using DDMS at the section “Using LogCat”