Android LifeCycle Methods -


i'm new android development , have question:

in method of android activity lifecycle must put event of views, example when click button happens.

would in oncreate or in onresume , why?

in of cases should have in oncreate because method called once , want set actions listeners once. onresume, according activity life-cycle may called several times, according activity life cycle doc, , set action listeners again no reason.

however, if have customizable behavior action listener each time activity becomes visible again, may worth set action listeners in onresume, apply small set of controls , guess rare.


Comments