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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:57:47+00:00 2026-05-16T04:57:47+00:00

I have successfully implemented my AutoCompleteTextView which is based off an SQLite query and

  • 0

I have successfully implemented my AutoCompleteTextView which is based off an SQLite query and is placed in an array adapter. That’s all working beautifully, however I can’t get my onclickevent working.

I just want to create an intent to pass the selected value to a new activity. I know how to create an onclicklistener. I am just unsure about how to apply it to the dropdown box of the AutoCompleteTextView.

  • 1 1 Answer
  • 1 View
  • 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-16T04:57:48+00:00Added an answer on May 16, 2026 at 4:57 am

    Nevermind. I’ve solved it. I was just executing poorly. The code below autocompletes my textview based off a simple SELECT SQLite statement and executes when the user selects the university from the dropdown list.

    The onclick event creates a new intent and starts a new activity passing the selection to this activity within the intent.

    final AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.ac_university);
    String[] universities = myDbHelper.getAllUnis(db);
    
    // Print out the values to the log
    for(int i = 0; i < universities.length; i++)
    {
        Log.i(this.toString(), universities[i]);
    }
    
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.list_item, universities);
    textView.setAdapter(adapter);
    
    //textView.setOnItemSelectedListener(this);
    textView.setOnItemClickListener(new OnItemClickListener() {
    
        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                                long arg3) {
    
            Intent intent = new Intent(Main.this, Campus.class);
            Bundle bundle = new Bundle();
    
            bundle.putString("university_name", arg0.getItemAtPosition(arg2).toString());
            bundle.putLong("_id", arg3);
            intent.putExtras(bundle);
            startActivity(intent);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully implemented a custom SimpleCursorAdapter for an AutoCompleteTextView, which suggests entries from
I have successfully implemented an SQLite database in my Android app insofar as I
I have successfully implemented a multi-language website in which user can change language by
I have been working with the jQuery UI Tab component, and have successfully implemented
I am newbie working on iOS application for iPad. I have successfully implemented a
I have successfully implemented the scrollTo jQuery plugin which scrolls to the next div
Has anyone successfully implemented a Java based solution that uses Microsoft SQL Server 2005
I have successfully implemented a restful service that works with my own client. Now,
I have successfully implemented a working UIScrollView layer on top of Cocos2d using this
I successfully implemented code that takes array data and runs a fast fourier transform

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.