I\'m always using onclick() event in most of my projects. But, I read about OnClickListener(). Can anyone tell what\'s the difference between these
everyone has mentioned about OnClickListener listner which one always used.
i want to add one more point android:onClick works as method and it's doesn't need to be reference so it's useful when you have to add button after some task executed so you cant't referenced it for OnClickListener.
For an example when we create viewpager with only layout (no fragments) if you put an button in any layout it insialized only when layout visible so you can't use method findViewById for Button in that case android:onClick becomed useful just put that method in activity!!