0

Could please someone explain pros and cons of subscribing to events, xml vs code approaches?

I suppose there should be some guidelines on that topic, but I can't imagine an use-case where one will be better that another. Maybe some best practices, or recipes?

It would be great if you share your experience and knowledge. Maybe some examples?

Thanks.

csprv
  • 59
  • 8
  • I never use onClick in xml because when I change the method name in code, it will not change the name in xml – Norutan Nov 25 '16 at 04:12
  • So you don't use the xml onClick just of code management / refactoring/ maintenance dependencies? – csprv Nov 25 '16 at 09:44
  • yes, but someone may have another style – Norutan Nov 25 '16 at 10:01
  • 1
    Possible duplicate of [Android onClick in XML vs. OnClickListener](http://stackoverflow.com/questions/21319996/android-onclick-in-xml-vs-onclicklistener) – shadox Nov 25 '16 at 10:15

0 Answers0