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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:12:29+00:00 2026-05-31T22:12:29+00:00

I have a Button which when clicked will execute an addQty method and in

  • 0

I have a Button which when clicked will execute an addQty method and in this method I need to set the value of a TextView on the same line as the Button was pressed. I have the position integer available to me but I cannot work out how to get the TextView.
I have a custom ArrayAdapter which sets this in the getView method:

ImageButton plus = (ImageButton) v.findViewById(R.id.qtyPlus);
plus.setTag(position);

My layout then does the following:

<ImageButton
   android:id="@+id/qtyPlus"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:src="@drawable/plus"
   android:onClick="addQty" />

My addQty method:

public void addQty(View v) {
        int position = Integer.parseInt(v.getTag().toString());

        Item tmp = (Item)adapter.getItem(position);
        Log.d("MyApp",tmp.getName());

}

This works as I am able to get the item object of the clicked row in the list, but how do I now set a TextView value in that ListView row?

  • 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-31T22:12:30+00:00Added an answer on May 31, 2026 at 10:12 pm

    You don’t set a new TextView value for that list row directly, instead you update the Item element with the new value and then call notifyDataSetChanged()(on the adapter object) to notify the adapter that you modified something and that it should update the ListView.

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

Sidebar

Related Questions

This is the a button which when clicked will open up Safari. -(IBAction)loginClicked:(id)sender{ NSLog(@loginClicked);
Is there a quick, easy way to have a button which, when clicked, will
So I have this button that when clicked on will send you to the
On my website, I have a button which when clicked displays a feedback form
I have a button which creates a div. Once clicked I would like to
I have this button which is not working correctly for hold button for a
I have a button which when toggled displays/hides a div ('.reportOptions'), this works perfectly
My code is meant to have a table which when clicked td will turn
I have a list of items in #/xxx which when clicked will pop up
On my page, i have a button, which on clicked, refreshes a jstree found

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.