forum

Home / DeveloperSection / Forums / Which is better way performance wise , andriod:onClick or set onClickListener for android objects

Which is better way performance wise , andriod:onClick or set onClickListener for android objects

Anonymous User158521-Jul-2015
Android docs mention two ways to set an onclick event on a button :
1.Using the android:onClick XML attribute where you just use the name of a public method with the signaturevoid name(View v) 
2. By using the setOnClickListener method where you pass an object that implement the OnClickListener interface. 

Which one is  correct ways ? Which is better techniques performance wise?

Please Expalin why

Updated on 22-Jul-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By