This approach has several problems: 1) You cannot ...
# android
a
This approach has several problems: 1) You cannot separately test
Activity
and
GpsService
without some really verbose DI setup which would not be needed if you could simply pass
GpsService
in constructor; 2) Your activity now should know about
GpsService
internal details, at least about its
requestCode
and
resultCode
in order to determine that the result in
onActivityResult()
is from
GpsService
request; 3)
GpsService
is now concerned with
Activity
details such as
requestCode
and
resultCode