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

  • Home
  • SEARCH
  • 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 8718757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:37:30+00:00 2026-06-13T06:37:30+00:00

HI i am filtering data in listview there is a one editbox with search….

  • 0

HI i am filtering data in listview there is a one editbox with search….

Now if i enter la and enter search button the filter will be done….

below is the code

    double lat[] = new double[] { 32.711857, 32.80964, 32.751261, 32.753932, 32.751622, 32.769955, 32.770677, 34.304875, 32.854782, 32.761829 };
double lon[] = new double[] { -117.159901, -117.238223, -117.247137, -117.16355, -117.165782, -117.162005, -117.16561, -118.461662, -117.27464,
        -117.172343 };

double latitude, longitude;

String places[] = new String[] { "Gaslamp", "Pacific Beach", "Ocean Beach", "Uptown", "Hillcrest", "Mission Valley", "Fashion Valley",
        "La Jolla", "San Diego","North Park" };

int zipCode[] = new int[] { 92101, 92109, 92107, 92103, 92103, 92123, 92008, 92037, 92115, 92104 };

Now when i click on SearchImageView the following code will be executed…

  ImageView imgSearch = (ImageView) findViewById(R.id.ivIconSearch);
    imgSearch.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (adapter != null) {
                adapter.getFilter().filter(edtSearch.getText().toString());
                adapter.notifyDataSetChanged();
            }
            return true;
        }
    });

Now when i click on List view the following code will be executed..

    adapter = new SimpleAdapter(PredefinedLocation.this, fillMaps, R.layout.list_item_deal, new String[]{"name"}, new int[]{R.id.name});
    // Adding data into listview
    lv.setAdapter(adapter);
    lv.setTextFilterEnabled(true);
    lv.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View view, int position, long id) {
            // TODO Auto-generated method stu

        }
    });

Here what should i have to write code so that i can get filterable latitude, longitude, zipcode…..

  • 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-06-13T06:37:32+00:00Added an answer on June 13, 2026 at 6:37 am

    I got the answer….

    Although i know that it is not efficient way but for me it’s solved the problem

    Here in adapter if i print adapter’s value i got an answer like below

         System.out.println(adapter);
    
      I got value like below ....
    
        "{name=SanDeigo}"
    
    
      based on that....
    
    
        Intent intent = new Intent(PredefinedLocation.this, MainActivity.class);
                int length = "{name=".length();
                String str = adapter.getItem(position).toString();
                if (str != null)
                    if (str.length() > 0)
                        str = str.substring(length, str.length() - 1);
    
                for (int i = 0; i < places.length; i++) {
                    if (places[i].equals(str)) {
                        intent.putExtra("nearLocation", places[i]);
                        //System.out.println("Near Location = " + places[i]);
                        intent.putExtra("latitude", lat[i]);
                        //System.out.println("LATITUDE = " + lat[i]);
                        intent.putExtra("longitude", lon[i]);
                        //System.out.println("LONGITUDE = " + lon[i]);
                        intent.putExtra("zipcode", zipCode[i]);
                        //System.out.println("ZIP CODE = " + zipCode[i]);
                        PredefinedLocation.this.startActivity(intent);
                        break;
                    }
                }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to search a MongoDB database filtering on a specific data item.
In jQueryMobile, I have written a data-role=listview component and I want to filter the
Is there a way of filtering the data of an iframe output? For example
I have a list like this <ul data-role=listview id=list data-filter=true></ul> it looks good on
Are there performance issues when retrieving and filtering data from views than from tables
Is filter_var any good for filtering data? What kind of bad data will it
Hi i have one editbox in that if user type the filtering should be
So I'm using an ajax request to pass some data for filtering purposes. Then
After being stumped by an earlier quesiton: SO google-analytics-domain-data-without-filtering I've been experimenting with a
I've got a bit of a problem with making my data loading and filtering

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.