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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:22:32+00:00 2026-06-05T17:22:32+00:00

here i am using an activity in which there is a list view,which I

  • 0

here i am using an activity in which there is a list view,which I am populating
form an xml string,the population is just fine,In the listview there are two buttons

clicking on which the no is increasing and decreasing.onsubmit buttons I want that all the
datum with the modified one will be shown in the submit.e.g two seaters are selected 2.

the code snippts are:

my xml 
private static String seatXml="<?xml version=\"1.0\" encoding=\"UTF-8\"?><seatlist>"
        +"<seatselection><seater>two</seater></seatselection>"
        +"<seatselection><seater>four</seater></seatselection>"
        +"<seatselection><seater>six</seater></seatselection>"
        +"<seatselection><seater>eight</seater></seatselection>"
        +"<seatselection><seater>ten</seater></seatselection>"
        +"</seatlist>";

here I am populating the listview

private void populateSeatList() {
    // TODO Auto-generated method stub
    seatItems=new ArrayList<HashMap<String,String>>();
    XMLParser parser=new XMLParser();
    Document doc=parser.getDomElement(seatXml);
    NodeList nl=doc.getElementsByTagName(KEY_RECORD);
    String seatName="";

    for (int i = 0; i < nl.getLength(); i++) {
        map=new HashMap<String, String>();
        Element e=(Element)nl.item(i);
        // adding each child node to HashMap key => value
        map.put(KEY_SEAT,parser.getValue(e, KEY_SEAT)); //this will fetch the seater value like 2 seater,3 seater
        map.put(KEY_SEAT_QTY,""+QTY);
        seatItems.add(map);
    }

    adapter=new SeatAdapter(this, seatItems);
    seatListView.setAdapter(adapter);
    //      makeAToast(seatName);

}

the getview function in the adapter class

int i=0;
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub
    View view=convertView;
    if(convertView==null)
        view=inflater.inflate(R.layout.seat_desc,null);
    TextView seatName=(TextView)view.findViewById(R.id.textView_seat_no);
    Button buttonMinus=(Button)view.findViewById(R.id.button_minus);
    Button buttonPlus=(Button)view.findViewById(R.id.Button_plus);
    final TextView seatInput=(TextView)view.findViewById(R.id.textView_seat_input);

    seatInfo=new HashMap<String, String>();
    seatInfo=data.get(position);

    seatName.setText(seatInfo.get(SeatSelectionActivity.KEY_SEAT)+" seater:");
    seatInput.setText(""+i);

    //    menuInfo.get(MenuScreenActivity.KEY_MENUNAME)
    buttonPlus.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated i stub
            i=Integer.parseInt(seatInput.getText().toString());
            if(!(i>=10))
                i++;
            seatInput.setText(""+i);
            //              seatInfo.put(SeatSelectionActivity.KEY_SEAT, seatInfo.get(SeatSelectionActivity.KEY_SEAT));
            seatInfo.put(SeatSelectionActivity.KEY_SEAT_QTY,seatInput.getText().toString());
            data.set(position, seatInfo);
            //              notifyDataSetChanged();

        }
    });

    buttonMinus.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO ,goto-generated method stub
            i=Integer.parseInt(seatInput.getText().toString());
            if(!(i<1))
                i--;
            seatInput.setText(""+i);
            //              seatInfo.put(SeatSelectionActivity.KEY_SEAT, seatInfo.get(SeatSelectionActivity.KEY_SEAT));
            seatInfo.put(SeatSelectionActivity.KEY_SEAT_QTY,seatInput.getText().toString());
            data.set(position, seatInfo);
            //              notifyDataSetChanged();
        }
    });

    return view;
}

if needed my sample project

  • 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-05T17:22:34+00:00Added an answer on June 5, 2026 at 5:22 pm

    I used this code to get all my selected seats & it worked

    buttonPlus.setOnClickListener(new OnClickListener() {
    
            @Override
            public void onClick(View v) {
                // TODO Auto-generated i stub
                i=Integer.parseInt(seatInput.getText().toString());
                if(!(i>=10))
                    i++;
                seatInput.setText(""+i);
    
                data.get(position).put(SeatSelectionActivity.KEY_SEAT_QTY, seatInput.getText().toString());
    
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one activity A, that has one button and one list view which
In my Android application, I have a simple list view with adapter. There's a
Is there a way to start an activity from a view? I have this
I am creating an android application in which there are two activites. One activity
I have created a custom listview that is populated using a row.xml file. Each
So I have my MainDisplayActivity which implements both Activity and LoaderManager.LoaderCallbacks<Cursor> . Here I
This question is an extension to the one raised here: Using factory_girl in Rails
EDIT: The plugin in question is located here . PHP beginner here using a
why are we using here 5 parameters for stringWithFormat : return [NSString stringWithFormat:NSLocalizedString(@LatLongFormat, @LatLongFormat),
Using Rational ClearCase v. 7.0.1.1 with UCM, I have a problem here when using

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.