Code Monkey home page Code Monkey logo

Comments (3)

ocram avatar ocram commented on June 3, 2024

Well, your implementation looks good. It seems you have indeed read the documentation well and checked other issues for a solution. Thank you!

  1. Did you try this on a real device or on the emulator? If it’s the latter, try a real device instead.

  2. In the onClick callback of your View.OnClickListener, the call

    location.beginUpdates();

    is definitely redundant. You can safely remove that.

  3. Copy your Log.i call and paste it at the end of the onPositionChanged callback of SimpleLocation.Listener. Of course, it might make sense to change the message string as well. Otherwise, you don’t see when new location data becomes available.

  4. Try changing the second argument of the constructor from true to false to switch between GPS location and network location.

Does that help?

In general, this is unfortunately quite a common problem, but still one that can easily be solved, I’d say:

from android-simplelocation.

spidgorny avatar spidgorny commented on June 3, 2024

If you target a newer Android platform, you should ask a user for access to their location explicitly.
https://developer.android.com/training/permissions/requesting

from android-simplelocation.

anmol-Git avatar anmol-Git commented on June 3, 2024

when i am overriding the onResume method my UI get stuck and black screen occur any suggestions

from android-simplelocation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.