listener - Android: how add opacity on ImageButton click? -


i thought use ontouchlistener , tracking down , events, setting alpha value, have add listener imagebuttons (they lot). wonder if there shortcut achieve result.

in case when user click on button , cause change opacity of button can do:

in xml file on button declaration add line:

android:onclick = "clickmethod" 

and in java file need implement clickmethod,

public void clickmethod(view view) {   // change opacity } 

so, if want same process(change button opacity) each button, in xml file each button add line

android:onclick="clickmethod" 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -