Can you post your layout file here? Are the other imageviews on the activity pointing to the same image as square00?
-- Jack Ha Open Source Development Center ・T・ ・ ・Mobile・ stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Apr 22, 4:11 pm, "Oliver M. Batista" <olivermbati...@gmail.com> wrote: > Hello guys, i'm having a problem with this imageview listener (see > code below) well the click event is only triggered when I click on the > square00 item (this is ok) but on the onclick method that does the > action, i use the reference passed by the method and the action is > applied to all the imageviews on the Activity but I want the action to > be apllied only for the square00 imageview. Somebody knows what's > wrong? > > public class HelloDroid extends Activity implements OnClickListener { > /** Called when the activity is first created. */ > > // Create an anonymous implementation of OnClickListener > private OnClickListener mCorkyListener = new OnClickListener() { > public void onClick(View v) { > // do something when the button is clicked > > ImageView asd = (ImageView)v; > asd.setAlpha(50); > > } > }; > > @Override > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main); > > // Capture our img from layout > ImageView img2 = (ImageView)findViewById(R.id.square00); > // Register the onClick listener with the implementation above > img2.setOnClickListener(mCorkyListener); > } > > } > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---