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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:50:19+00:00 2026-06-06T03:50:19+00:00

I have a listview that contain several EditTexts created dynamically according to the number

  • 0

I have a listview that contain several EditTexts created dynamically according to the number of elements in listview.The items in listview are filled by data from server. With each edit text, there is a ‘add’ button in each row in that same listview. What i want is ,when the user inputs some number in those edit text boxes and click on ‘add’ button, the numbers input should be stored in some array in the order of clicking(first input in first position of array).The data is for future use to show input numbers in a seperate listview. In my code,when i input some number in edit text box and click ‘add’ only the first input works.In next clicks,nothing works(toast is shown here)..pls help..You may edit the code.Thanks in advance.(what i want is to store all those inputs, its user’s choice to input in selected boxes only)

public void Addcart(View v)
{

try{    final EditText editnum= (EditText) findViewById(R.id.edittext); 

View.OnClickListener handler = new View.OnClickListener(){
    public void onClick(View v) {   
        if(v.getId()==R.id.addbutton)
        { //  switch (v.getId()){
      //  case R.id.addbutton:
            Toast.makeText(getBaseContext(), 
                    "Input: " + editnum.getText().toString(), 
                    Toast.LENGTH_SHORT).show();
           //   break;
        }
    }
};

findViewById(R.id.addbutton).setOnClickListener(handler);
}
catch(Exception e){
    Log.e("Android Edit Text Example", e.toString());

}

  • 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-06T03:50:22+00:00Added an answer on June 6, 2026 at 3:50 am

    I think if you have created class which extends BaseAdapter. which does work of rendering view of list inside getView() method.
    So, you can easily get the position of that list row (getView(int ) argument is position your rendering) and also inside it you can create and your edittext dynamically also add button setting listeners.

    now you can get position of row your clicking by using onItemclickListener() for that list returns the position of row hit by user,

    so in on Addbutton click you can create Vector and insert that entered element in vector at specified index by using it’s method.

    so, next time you render new list you can use this vector as list to pass as data of numbers.

    hope explanation works for you ..

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

Sidebar

Related Questions

I have ListView that uses a GridView to display several columns of data. Two
I have a ListView that I am populating with items from an ObservableCollection .
I have a listview that can contain up to roughly 2,000 listview items I
Hey guys i have a problem. I have a listview that is dynamically filled.
I have a ListView that contain several TextViews. Once a TextView is pressed I
I have a listview that is loaded with a list of objects that contain
I have ListView that shows data: <ListView android:id=@+android:id/list android:layout_width=fill_parent android:layout_height=wrap_content> </ListView> The headlines is
I have a ListView that displays a bunch of homework assignments. The ListView items
A have a ListView that is rendered with multiple items. Now I want to
I would like to have a ListView that would have have items similar to

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.