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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:28:01+00:00 2026-06-13T11:28:01+00:00

I have a custom table cell which basically has 2 buttons, one textview and

  • 0

I have a custom table cell which basically has 2 buttons, one textview and one edit text. Next to each edit text there is a plus and minus button. Effectively to increment / decrement the number in the text box.

I can’t work out how I link the buttons to the right text box. I.e. when I press plus, have a routine that only works for the edittext box in it’s row. Do I have to set a custom ID for each text box?

I have all the text coming out correctly for the questions.

My custom cell is:

<TextView
    android:id="@+id/txtOption"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:layout_weight="0.00"
    android:text="Medium Text"
    android:textAppearance="?android:attr/textAppearanceMedium" />

<Button
    android:id="@+id/btnPlus"
    style="?android:attr/buttonStyleSmall"
    android:layout_width="49dp"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_below="@+id/txtOption"
    android:layout_weight="0.00"
    android:text="+" />

<Button
    android:id="@+id/btnMinus"
    style="?android:attr/buttonStyleSmall"
    android:layout_width="49dp"
    android:layout_height="wrap_content"
    android:layout_alignBaseline="@+id/btnPlus"
    android:layout_alignBottom="@+id/btnPlus"
    android:layout_toRightOf="@+id/btnPlus"
    android:layout_weight="0.00"
    android:text="-" />

<EditText
    android:id="@+id/tbAnswer"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/btnMinus"
    android:layout_toRightOf="@+id/btnMinus"
    android:ems="10"
    android:inputType="number" >

    <requestFocus />
</EditText>

My custom cell is being called with:

    class CustomAdapter extends BaseAdapter
    {

    @Override
    public int getCount() {

        return mDescription.size();
    }

    @Override
    public Object getItem(int arg0) {

        return null;
    }

    @Override
    public long getItemId(int arg0) {

        return 0;
    }

    @Override
    public View getView(int arg0, View arg1, ViewGroup arg2) {

        LayoutInflater inf=getLayoutInflater();
        View v=inf.inflate(R.layout.noncriticalasset, arg2,false);

        Button btPlus=(Button)v.findViewById(R.id.btnPlus);
        Button btMinus=(Button)v.findViewById(R.id.btnMinus);

        TextView tv=(TextView)v.findViewById(R.id.txtOption);

        EditText et=(EditText)v.findViewById(R.id.tbAnswer);

        tv.setText(mDescription.get(arg0).toString()); 


        return v;
    }


}

I will also have to collate all the information from all of the textboxes afterwards and write one query for each. Do I have a submit button that does a for each? (Is there an auto array created or similar?)

Tom

  • 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-13T11:28:02+00:00Added an answer on June 13, 2026 at 11:28 am

    Is this what you need ?

    In the onclick() of the button use

    @Override
        public void onClick(View v) {
    
                try {
    
                    position = listview
                            .getPositionForView((View) v.getParent()); // position is an integer variable which helps you identify which item's plus button  was clicked
                    Log.v("Position id", "" + position);
    
                    // do some manipulations 
                    notifyDataSetChanged();
    
                } catch (Exception e) {
    
                    Log.e("error", "error" + e.getMessage());
    
                }
    
                break;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an edit screen which is comprised of one huge UITableView. Each cell
I have a custom table cell which has a custom ui view in it.
I have a table cell with a custom backgroundView which looks great while in
I have a custom table that has a custom format to it, which makes
I have a custom table created which has a foreign constraint on the core_website
I have a table cell for which I set its contentView to a custom
I have a custom cell for my table view which I have designed using
I have a custom table cell which contains a number of UILabels. At runtime,
I have a UITapGestureRecognizer in a custom table cell which is intended to do
I am making a custom cell which has text fields and as a result

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.