android - Which one is better option for maintaining application or activities? -
which 1 better option application or activities?
a. baseactivity class, [or]
b.singleton class.
in application of activities same actions show toasts, maintaining sessions, static variables,show edittext errors, http request/response, etc., i'm extends baseactivity in activities needed.
you're on right path, baseclass
preferred because of thing mentioned (manipulating toasts
, edittext
functions) require context
work with. singleton class need context
passed every method call - baseclass not (since technically context
itself).
Comments
Post a Comment