Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6604241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:07:41+00:00 2026-05-25T19:07:41+00:00

I have two issues, the first is that I have a String Builder that

  • 0

I have two issues, the first is that I have a String Builder that obtains an address and prints it to a edittext:

  Geocoder mGC = new Geocoder(context,Locale.getDefault());
    address = mGC.getFromLocation(lat, lng, 1);

    if (address !=null){
     Address currentAddr = address.get(0);
     mSB = new StringBuilder();
     for (int i=0; i<currentAddr.getMaxAddressLineIndex(); i++){
     mSB.append(currentAddr.getAddressLine(i)).append(", ");
    }
   outputText.setText(mSB.toString());

}

The problem is randomly the address = mGC.getFromLocation(lat, lng, 1); line returns a null pointer exception. Sometimes it works for days…then suddenly it has a null pointer exception; anyone know why?

Also my second issue is my GPS fix takes some time, I am using the GPS Satellite for it; is there a way I can use Network provided info first and then the GPS Satellite for a faster fix?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:07:41+00:00Added an answer on May 25, 2026 at 7:07 pm

    About your second issue:
    You need to have two location listeners, one for network and the other one for GPS. Then you should use onLocationChanged on each listener to do your logic, in this case first use the network location, and once you get an update for the GPS one you use that one instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not the first to have these issues, and will list some reference posts
I am looking to find a way to take two objects that have identical
I have two leaks shown by the instruments tool. I have looked around on
I'm on the cusp of starting work on a new webapp. Part of this
Given the following code. Is there any potential for the first DrawString method to
I am trying to send an outlook appointment from an ASP.NET website. I have
This issue stems from an accounting package that spits out text-based reports with rows
I'm using bcp to load a table from a CSV exported from another table
I'm working on a (rather) simple 2D project in OpenGL. It's some sort of
So, I'm learning C++, and I've run into something which I know how to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.