I think I'm missing something

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

I think I'm missing something

Postby AdamBowles » Wed Mar 04, 2009 10:05 pm

First off; I am new to the Android development scene, that includes Java too. I've never used it before.

Now, I have sat in front of my extremely basic source code for two days now, and I can't seem to work out how to link code to the event of an ImageView being clicked.

I have a series of ImageViews set up from main.xml, and I think I need to set up an onClickListener in the main .java file.

I have looked at a lot of 'Android Basics' tutorials, including some on this site and this is too basic to need covering, or too advanced for me to have encountered yet, I'm guessing the former.

Basically, I would like someone to explain how to enable an ImageView item to be clicked and execute some lines of code.
Once Poster
Once Poster
Posts: 1
Joined: Wed Mar 04, 2009 9:01 pm


Postby MrSnowflake » Wed Mar 04, 2009 11:12 pm

You should look through the awt/swing tutorials on the java site, they use the same listener stuff.

An yes, you should use setOnClickListener().
User avatar
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium


Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests