07.01.2013 Views

David Defour - Université de Perpignan

David Defour - Université de Perpignan

David Defour - Université de Perpignan

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

IMAGEBUTTON, VARIATION 1<br />

• I<strong>de</strong>a<br />

• A push button displaying an image<br />

• Main Listener type<br />

• View.OnClickListener<br />

• Key XML attributes<br />

• android:src<br />

jeudi 26 janvier 12<br />

If you just want to display an<br />

image, but not take action when it<br />

is clicked, see the ImageView<br />

class.<br />

• The image for the button. Refers to the base name (minus the extension) of an image file<br />

in the res/drawable fol<strong>de</strong>r<br />

• Supported formats are png, jpeg, gif, and bmp.<br />

You can also refer to a drawable XML file as in next example.<br />

• The localization lecture will talk about drawable-xdpi fol<strong>de</strong>rs<br />

• Can also be set in Java with setImageDrawable<br />

• android:onClick<br />

• The event handler method

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!