Android dynamic Multicolumn Listview
<p>I have a multicolumn List view like the one shown in the image, i used custom adapters to populate this custom list.so the question is how to get data on click of submit button means when i click submit button i should get data like name, price and quantity of only checked checkbox....Thanx in advance.</p>

<p>In my Main xml i have a listview and in mainlist xml i have txtname, txtprice, edittext and checkbox and use efficient adapter.
i'm able to view data in list view, bt the problem is i m unable to save data on click of submit button... so plz help me out, with a sample code, bcz m new to android..</p>

<p>the following is my code..</p>

<pre><code>public class Menu extends Activity {
ListView list;
Cursor cursorMenu;
Button btnPlaceOrder;
Button btnShowOrders;
String Descstr="";
String strtotal="";

List&lt;String[]&gt; lstSelectedItems = null;


DBAdapter db = new DBAdapter(this);


private  String[] strName;
private  String[] strPrice;
private  String[] strDescription;

private  class EfficientAdapter extends BaseAdapter {
    private LayoutInflater mInflater;


    public EfficientAdapter(Context context) {
        mInflater = LayoutInflater.from(context);
    }

    public int getCount() {

        try {
            return strName.length;
        } catch (Exception e) {
            //Toast.makeText(Menu.this, "No Data !", Toast.LENGTH_LONG).show();
            return 0;
        }

    }

    public Object getItem(int position) {
        return position;
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        final ViewHolder holder;
        if (convertView == null) {
            convertView = mInflater.inflate(R.layout.menulist, null);

            holder = new ViewHolder();
            holder.text = (TextView) convertView
                    .findViewById(R.id.txtItemName);
            holder.text2 = (TextView) convertView
                    .findViewById(R.id.txtPrice);
            holder.text3 = (TextView) convertView
                    .findViewById(R.id.txtDescription);
            holder.etext3 = (EditText) convertView
                    .findViewById(R.id.txtQty);
            holder.chk = (CheckBox) convertView
                    .findViewById(R.id.chkBox);



            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        holder.text.setText(strName[position]);
        holder.text2.setText(strPrice[position]);
        holder.text3.setText(strDescription[position]);
        return convertView;
    }

     class ViewHolder {
        TextView text;
        TextView text2;
        TextView text3;
        EditText etext3;
        CheckBox chk;

    }
}

public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.menu);

    btnPlaceOrder = (Button) findViewById(R.id.btnPlaceOrder);
    btnPlaceOrder.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {


        }
    });


    /*db.open();
    cursorMenu = db.menu_getAllTitles();

    int rowcount = cursorMenu.getCount();

    System.out.println("---- +++++ " + rowcount);
    System.out.println("---- column +++++ " + cursorMenu.getColumnCount());

    int index = 0;
    if (rowcount &gt; 0) {
        strName = new String[rowcount];
        strPrice = new String[rowcount];
        strDescription = new String[rowcount];
        if (cursorMenu.moveToFirst()) {
            do {

                strName[index] = cursorMenu.getString(1);
                strDescription[index] = cursorMenu.getString(2);
                strPrice[index] = cursorMenu.getString(3);
                Log.v(TAG, "Name-- " + strName[index] + "Price-- "
                        + strPrice[index]);
                index++;
            } while (cursorMenu.moveToNext());
        }
        cursorMenu.close();

    } else {
        Toast.makeText(this, "No Data found", Toast.LENGTH_LONG).show();
    }*/




    list = (ListView) findViewById(R.id.lstMenu);
    list.setAdapter(new EfficientAdapter(this));
    System.out.println("--List Child count-----"+list.getChildCount());
    System.out.println("--List count-----"+list.getCount());

    list.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,
                long arg3) {
            Toast.makeText(getBaseContext(),
                    "You clciked " + strName[arg2] + "\t" + strPrice[arg2],
                    Toast.LENGTH_LONG).show();

        }
    });

}
</code></pre>

<p>}</p>
