Should I place event listeners on the onCreate method or on the onResume method?

Viewed 32

I'm a begginer to android development, and I'm trying to add an event listener to a button without using an onClick() in the xml file. Where should I place my event listener and should I remove it somewhere, say, on the onStop method?

Thanks

2 Answers

You need to put into onCreate, and it listen, whenever you perform that event.

Related