android - Should I use many simple listeners or one complex one? -
android - Should I use many simple listeners or one complex one? -
i'm new developing in android although have much experience java , .net (but i've been on hiatus bunch of years). first time programming mobile platforms , have been thinking limited memory of these devices usual approach event-handling may not work here.
usually, prefer have dedicated listener / event-handler each control, let's say, bunch of buttons. think easier maintain code , feels more object-oriented-like, say.
but in java, each listener new instance of class, if have 20 buttons , 20 listeners, think i'm going spend more memory necessary. true?
what pros , cons of using 1 listener these buttons? recommended practice?
thanks.
don't headache 20 listeners. memory footprint neglectable. seek take variant makes write less code , more robust , scalable.
android events listeners
Comments
Post a Comment