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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:49:03+00:00 2026-06-06T09:49:03+00:00

Up front: This is my first attempt at an Android app. I’m in that

  • 0

Up front: This is my first attempt at an Android app. I’m in that strange place of not knowing what to search for to find the answer to my question.

What I have accomplished is:

  • Created a custom class myCustomClass with properties of ‘title’ and ‘youTubeUrl’
  • Created an ArrayList<myCustomClass>
  • Added multiple elements to ArrayList<myCustomClass>
  • Created a custom ArrayAdapter and attached it to the the arraylist.
  • Added an onItemClickListener to the custom ArrayAdapter.

All of that works good. I would like to show the title in the ListView and then when the user clicks the list view item, I’d like to get a reference to the youtubeUrl property.

Here’s what I have for the adapter code:

MyListAdapter myListAdapter = new MyListAdapter(this, R.layout.my_list, elements);
myList.setAdapter(myListAdapter);
myList.setOnItemClickListener(new OnItemClickListener() {
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        String item = ((TextView)view).getText().toString();
        Toast.makeText(getBaseContext(), item, Toast.LENGTH_LONG).show();
    }
});
myListAdapter.notifyDataSetChanged();

Thanks for your help.

  • 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-06T09:49:03+00:00Added an answer on June 6, 2026 at 9:49 am

    You can use the position property in onItemClick to go back to your data source and find the relevant item. From there you should be able to retrieve the Url.

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

Sidebar

Related Questions

This is the first time I am working for a front-end project that requires
This is a dumb question and I know the answer is sitting in front
As a mostly front-end developer, this is in the realm of computer science that
This is my lame first attempt. I would like to get a count of
This is my first attempt at CGI (I know some Perl) but i'm falling
This is my first attempt to do unit tests, so please be patient with
Alright, I am going to state up front that this question may be too
I've never come across this extension before. It's being used for a front-end interface
I noticed that some stylesheets have something like this: body { font-size: 62.5%/1.2em; }
Just to clarify up-front: I'm talking about unioning geometry, not the SQL keyword UNION

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.