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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:29:42+00:00 2026-06-03T09:29:42+00:00

I have a ListView ,checkbox and spinner in one layout , and on different

  • 0

I have a ListView ,checkbox and spinner in one layout , and on different layout i have called the listview item by parsing it from xml. how to send collectively the value of checkbox , spinner and the list view item names by using http post
I want the detail code for explanation.

Here is my activity where i have parsed into xml and declared it into listview

public class Hut extends ListActivity {


static final String URL = "http://192.168.1.112/andro/index.php/androctrl/provider_detail/";

    // XML node keys
    static final String KEY_ITEM = "element"; // parent node
    static final String KEY_ID = "foodjoint_id";
    static final String KEY_NAME = "foodjoint_name";
    static final String KEY_LAT = "foodjoint_latitude";
    static final String KEY_DESC = "foodjoint_description";


     @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.pizzahut);



            ArrayList<HashMap<String, String>> menuItems = new ArrayList<HashMap<String, String>>();

            XMLParser parser = new XMLParser();
            String xml = parser.getXmlFromUrl(URL); // getting XML
            Document doc = parser.getDomElement(xml); // getting DOM element

            NodeList nl = doc.getElementsByTagName(KEY_ITEM);
            // looping through all item nodes <item>
            for (int i = 0; i < nl.getLength(); i++) {
                // creating new HashMap
                HashMap<String, String> map = new HashMap<String, String>();
                Element e = (Element) nl.item(i);
                // adding each child node to HashMap key => value
                map.put(KEY_ID, parser.getValue(e, KEY_ID));
                map.put(KEY_NAME, parser.getValue(e, KEY_NAME));
                map.put(KEY_LAT, "Rs." + parser.getValue(e, KEY_LAT));
                map.put(KEY_DESC, parser.getValue(e, KEY_DESC));

                // adding HashList to ArrayList
                menuItems.add(map);
            }

            // Adding menuItems to ListView
            ListAdapter adapter = new SimpleAdapter(this, menuItems,
                    R.layout.list_item,
                    new String[] { KEY_NAME, KEY_DESC, KEY_LAT }, new int[] {
                            R.id.name, R.id.desciption, R.id.cost });

            setListAdapter(adapter);

            // selecting single ListView item
            ListView lv = getListView();





     }
     //the continue button
     public void onClick(View v)
        {
            Intent personal = new Intent(this, UserPersonal.class);
            startActivity(personal);
        }

here is my pizzahut.xml where is just my list view and button to submit

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white" >
 <RelativeLayout
        android:id="@+id/RelativeLayout1"
        android:layout_width="181dp"
        android:layout_height="504dp"
        android:background="@color/white"
        android:gravity="fill"
        android:orientation="vertical" >
  <ListView
            android:id="@android:id/list"
            android:layout_width="216dp"
            android:layout_height="483dp"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true" >

        </ListView>






        <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true"
            android:text="@string/picktime" />

    </RelativeLayout>

</ScrollView>

Here is my list_item.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">  


    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="483dp"
        android:orientation="vertical" >

        <!-- Name Label -->

        <TextView
            android:id="@+id/name"
            android:layout_width="104dp"
            android:layout_height="wrap_content"
            android:paddingBottom="2dip"
            android:paddingTop="6dip"
            android:textColor="#dc6800"
            android:textSize="16sp"
            android:textStyle="bold" />

        <!-- Description label -->
        <TextView
            android:id="@+id/desciption"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:textColor="#acacac"
            android:paddingBottom="2dip">
        </TextView>
        <!-- Linear layout for cost and price Cost: Rs.100 -->
        <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <!-- Cost Label -->
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#5d5d5d"
            android:gravity="left"
            android:textStyle="bold"
            android:text="Cost: " >
        </TextView>
        <!-- Price Label -->
        <TextView
            android:id="@+id/cost"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#acacac" 
            android:textStyle="bold"
            android:gravity="left">
        </TextView>

        </LinearLayout>

        <CheckBox
            android:id="@+id/checkBox1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="CheckBox" />


        <Spinner
            android:id="@+id/spinner1"
            android:layout_width="118dp"
            android:layout_height="wrap_content" />

    </LinearLayout>

</LinearLayout>

whenever i will click on button check [ pizzahut.xml and PizzaHut.java]

i want to HTTPPost menu item name [got from xmlparsing ] , the checkbox value if selected , the spinner value togetherly.please give me the complete explanation.

  • 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-03T09:29:43+00:00Added an answer on June 3, 2026 at 9:29 am

    From your above code i found out that you are getting Title ,Description and cost value from XML parsing.You can have this value from XML and pass it to your other activity by following code

    list.setOnItemClickListener(new OnItemClickListener() {
    
                @Override
                public void onItemClick(AdapterView<?> parent, View view,
                        int position, long id) {
    
                    HashMap<String, String> data = menuItems.get(position);
    
                    String title = data.get("foodjoint_name");
                    String description = data.get("foodjoint_description");
                    String price = data.get("foodjoint_latitude");
    
    
                    Intent personal = new Intent(this, UserPersonal.class);
                startActivity(personal);
                    in.putExtra("title", title);
                    in.putExtra("descp", description);
                    in.putExtra("DURATION", pubdate);
                    in.putExtra("URL", imagename);
                    startActivity(personal);
    
                }
            }); 
    

    and In other activity you can retrieve this by following code

    Bundle extras = getIntent().getExtras(); 
            if(extras !=null)
            {
                Title = extras.getString("title");
                Description = extras.getString("descp");
                ImageUrl = extras.getString("URL");
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListView with a CheckBox as one of the columns, bound to
I have a listView with checkbox which populate from sqlite table. I need to
I have a ListView with a ContextMenu, it has one CheckBox (the CheckBox has
I have a listview with multiple columns. One of the columns is a checkbox,
I have a ListView where each item has a checkbox. Initially there are no
I have an Android ListView with rows that include one checkbox, and four text
I have a ListView that I am populating with items from an ObservableCollection .
I have a ListView Control in WindowsForm and also this Listivew has a checkBox
I have a ListView and an adapter in whick I create a linear layout
i have a listview with checkbox in each rows. i'm using custom cursoradapter and

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.