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 6376255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:43:17+00:00 2026-05-25T01:43:17+00:00

I am using a button called find geopoint. on clicking that button I am

  • 0

I am using a button called find geopoint. on clicking that button I am supposed to go to another activity. In that activity I have displayed the database in a listview but when I click that button the app crashes. Here’s my code:

public Display (String lat,String lon,String address ,String name1)
{
   this.lat=lat;
   this.lon=lon;
   this.address=address;
   Geo_Create_Table=name1;
}

public void display()
{
    Log.d("hussain", lat);
    db=d.getReadableDatabase();
    Cursor c=db.query(Geo_Create_Table, new String[]{lat+"",lon+"",address}, null,null, null, null, null);
        if (c != null) 
        {
        c.moveToFirst(); // it's very important to do this action otherwise your Cursor object did not get work
            int lat = c.getColumnIndex("latitude"); 
            int lon = c.getColumnIndex("longitude"); 
            int add = c.getColumnIndex("address"); 
            if (c.isFirst()) 
            { 
                int i = 0; 
                /* Loop through all Results */ 
                do 
                { 
                     i++; 
                     String latitude1 = c.getString(lat); 
                     String longitude1 = c.getString(lon);
                     String add1 = c.getString(add); 

                     /* Add current Entry to results. */ 
                     results.add("" + i + ": " + latitude1 + " (" + longitude1 + ": " + add1 + ")"); 
                } while (c.moveToNext()); 
           }
        }       
        this.setListAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, results)); 
  }

pls help i have shared the db between 2 activities it is called geo_create_table

  • 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-25T01:43:18+00:00Added an answer on May 25, 2026 at 1:43 am

    Without the LogCat output (please do post it so we can pinpoint the issue), I can only guess that one of d or results is uninitialised, causing a NullPointerException. Neither of these are initialised in the constructor you posted, so this seems likely. It could also be that results is not set up to take objects of type String, but I doubt that’s it.

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

Sidebar

Related Questions

I'm using WatiN to parse my web site. I have a button that starts
Actually I created a button using the cobogw widget library. But the button does
I've deconstructed a standard WPF button using Blend and have managed to create a
I'd like to add a click handler for a button using jQuery, but the
I am sure this will have been answered but I proved unable to find
I have a countdown timer in javascript that is called by a code behind
I have a JQuery silder that I'm using to set the score on a
I have searched, but can not find the answer I'm looking for. I want
Suppose I have two buttons that are ivar outlets. One is called Blue and
I'm using the UISearchBar (but not the SearchDisplayController that's typically used in conjunction) and

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.