0

I have a Question. If I want to use Locations services in other activity for Example CafePlaces.class which requires Location Services in I have defined

LocationListener,
        GoogleApiClient.ConnectionCallbacks,
        GoogleApiClient.OnConnectionFailedListener

And my MainActivity doesn't use any Location Services so I don't have any of the Location methods and calls within the MainActivity. Would it crash my app when I try to access CafePlacess.class ?

If I have to implement the Location Methods within the MainActivity and I don't which to use it within the MainActivity and call all the Location Updates to another Activity as CafePlaces.class how should I go about it?

And in AndroidManifest where should declare the google play services meta data?

I have am already facing a lot of problems with my location services which fails to get location updates and it crashes. I have almost tried every possible solution I could tinker about.

here is my question too:

Community
  • 1
  • 1
Sagar Atalatti
  • 486
  • 1
  • 8
  • 21

1 Answers1

0
  1. Use a service class which will fetch the location for you and store it some where like shared preference etc. and access the location data from there. this data can be accessed from any class.
  2. Play service should be declared inside <application> tag
Mr Lister
  • 45,515
  • 15
  • 108
  • 150
prabhat yadav
  • 93
  • 2
  • 11