Where to set all Listeners?

前端 未结 5 1985
旧巷少年郎
旧巷少年郎 2020-12-18 21:50

Where to set all Listeners for the user interfaces?
Is it good practice to set them in onCreate? This looks so unstructured and strange.
Is

5条回答
  •  庸人自扰
    2020-12-18 22:31

    You can set onClick property for any view in xml .So now u have no need to find and set onClick in onCreate.Now u need to define public method in activity of name u mentioned in xml . This looks constructed.

提交回复
热议问题