Attempt to invoke virtual method ‘double android.location.Location.getLatitude()’ on a null object reference
I want to navigate to a location from my current position. The latitude and longitude are obtained from the database that was called at the beginning of the application
the first screen “DATABASE”
the second screen “PROFIL PERUSAHAAN”
the third screen “MAPSnav”
I suspect the error occurred because the application couldn’t read the database. However, other applications with similar blocks work just fine. It’s only in my app that this error shows up.
Thank you for all the responses that have been given