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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:50:02+00:00 2026-05-15T20:50:02+00:00

I have a click event hooked up to my listview as shown. int[] GenusListIDs

  • 0

I have a click event hooked up to my listview as shown.

int[] GenusListIDs = { R.id.txt_ID, R.id.txt_Genus, R.id.txt_Count };
        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.genusitem, cursor_genuslist, service.GenusListColumns, GenusListIDs);

        ListView list_Genus = (ListView)findViewById(R.id.list_Genus);
        list_Genus.setAdapter(adapter);
        list_Genus.setOnItemClickListener(new OnItemClickListener(){
            @Override
            public void onItemClick(AdapterView parent, View view, int position, long id)
            {
                try
                {
                    Log.println(1, "ItemClick", view.toString());
                    TextView tv = (TextView)view;
                    String genus = (String) tv.getText();
                    Intent i = new Intent(getBaseContext(), Cat_Species.class);//new Intent(this, Total.class);
                    /*view
                    i.putExtra("id", id);*/
                    startActivity(i);
                }
                catch(Exception ex)
                {
                    Log.println(1, "item-click-event", ex.getMessage());
                }
            }
        });

I need to pass a string param to the new intent based on which listitem they clicked on. The value I want to pass is in the listitem called txt_Genus. How do I get that value out of the listitem to pass to the intent? Don’t pay attention to my experiments please haha.

  • 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-15T20:50:03+00:00Added an answer on May 15, 2026 at 8:50 pm

    This should do it.

    TextView tv = (TextView)view.findViewById(R.id.txt_Genius);
    String genus = tv.getText().toString();
    

    Then put it into the intent extras, I think you already know this bit.

    i.putExtra("genius", genius);
    

    Edit;

    In your new activity you would access the intent and get the extras bundle. You can then access anything you placed in the intent on your previous activity like below;

    Bundle extras = getIntent().getExtras();
    String genius = extras.getString("genius");
    // pop some toast to show the value of genius - not required but shows it works :) 
    Toast.makeText(this, "Genius value: " + genius, Toast.LENGTH_SHORT).show();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following click event $(.element).click(function() { var idNum = $(this).getID; $('#new-'+idNum).fadeIn(); });
I have a menu click event that looks something like this.... Public Sub ToolbarManager_ToolClick(sender
I am trying to have a click event on a new form that gets
I have hooked into the ListBoxItems' double-click event using the ff. code in my
I have a click event that does this: $('table tbody td').click( function (e) {
EDIT** I have this click event $('.next-question').click(function () { $('td').removeClass('highlight-problem'); var r = rndWord;
I have a .click() event on an element. After it's closed, this mob has
i have a click event for $('#blah div'). div has text inside of it
On page1.php I have a click event that causes the user to be redirected
It seems that the WPF Rectangle shape does not have the Click event defined.

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.