LISTVIEW WITH CHECKBOX USING CUSTOM ADAPTER CLASS IN ANDROID : I was creating app like e-commerce with listview that containing images, textbox and one checkbox. Now my question is that i want choose(click) max 3 item from listview and checked item pass to next activity on OnClick on button. After going to next activity it will hold that checked item for filling the user info. After filling user info she/he pressed button, onto the button click it select all checked item and user info and send it to send my database which is located at server side. I will posted this question on stack overflow also but answer is not getting their. Please help me solve this issue. or provide some link which are used info as like this.:( And one more main thing is that my listview data will retrieves from server using json and php. and i want send again back it to server after selecting item from listview. Thank You 

Here is my code of lisview

    public class  Hotels extends Activity
    {
    // Declare Variables
    JSONArray jsonarray = null;
    SQLiteDatabase sqLite;
    public static final String TAG_NAME = "name";
    public static final String TAG_LOCATION = "location";
    public static final String TAG_DESC = "description";
    String name,arrival_date,departure_date,image,location,description,adult,kids;

    ProgressDialog loading;
    ListView list;
    Button booknow;
    ListViewAdapter adapter;
    private ArrayList<Product> itemlist;
    Product product;


    static String Array = "MyHotels";
    View view;
    CheckBox click;
    ArrayList<String> checked = new ArrayList<String>();
    String hotel = "http://app.goholidays.info/getHotelData.php";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.all_item_layout);
        itemlist = new ArrayList<Product>();
        new ReadJSON().execute();

        click = (CheckBox) findViewById(R.id.mycheckbox);
        booknow = (Button) findViewById(R.id.bookhotel);
        product = new Product();
        list = (ListView) findViewById(R.id.myimagelist);

        booknow.setOnClickListener(new MyPersonalClickListener("book_hotel",product,getApplicationContext()));
    }

    class ReadJSON extends AsyncTask<String, Void, String> {
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            loading = ProgressDialog.show(Hotels.this,"Fetching Data","Please wait...",false,false);
        }
        @Override
        protected String doInBackground(String... args) {
            Product tempMenu;
            try {
                JSONObject jsonobject = JSONfunctions.getJSONfromURL(hotel);
                jsonarray = jsonobject.optJSONArray(Array);
                //parse date for dateList
                for (int i = 0; i < jsonarray.length(); i++) {
                    tempMenu = new Product();
                    jsonobject = jsonarray.getJSONObject(i);

                    tempMenu.setName(jsonobject.getString("name"));
                    tempMenu.setLocation(jsonobject.getString("location"));
                    tempMenu.setImage_path(jsonobject.getString("image_name"));
                    tempMenu.setDescription(jsonobject.getString("description"));
                    tempMenu.setFacility1(jsonobject.getString("facility1"));
                    tempMenu.setFacility2(jsonobject.getString("facility2"));
                    tempMenu.setFacility3(jsonobject.getString("facility3"));
                    tempMenu.setFacility4(jsonobject.getString("facility4"));
                    tempMenu.setStar(jsonobject.getString("star"));
                    itemlist.add(tempMenu);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        }

        @Override
        protected void onPostExecute(String result) {
            super.onPostExecute(result);
            adapter = new ListViewAdapter(Hotels.this, itemlist);
            list.setAdapter(adapter);
            loading.dismiss();
        }
    }

    private class MyPersonalClickListener implements View.OnClickListener {
        String book_hotel;
        Product name;
        Context context;
        public MyPersonalClickListener(String book_hotel, Product product, Context context) {
            this.book_hotel = book_hotel;
            this.name = product;
            this.context = context;
        }
        @Override
        public void onClick(View v){

            if (click.isChecked()) {
                startActivity(new Intent(Hotels.this, BookHotel.class));
            }
            else
            {
                Toast.makeText(context, "Please Select Hotel", Toast.LENGTH_SHORT).show();
            }
        }
    }
    }

Adapter class of listview

    public class ListViewAdapter extends BaseAdapter {

    Context context;
    LayoutInflater inflater;
    ArrayList<Product> AllMenu = new ArrayList<>();
    ImageLoader imageLoader;
    int checkCounter = 0;

    public ListViewAdapter(Context context, ArrayList<Product> itemlist) {
        this.context=context;
        AllMenu = itemlist;
        imageLoader = new ImageLoader(context);
        checkCounter = 0;
    }


    public int getCount() {
        return AllMenu.size();
    }

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

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

    public View getView(final int position, final View convertView, ViewGroup parent) {
        // Declare Variables
        final Product tempMenu = AllMenu.get(position);
        final CheckBox c;
        final ImageView image_path,facility1,facility_1;
        ImageView facility2,facility_2;
        ImageView facility3,facility_3;
        ImageView facility4,facility_4;
        ImageView star1,star2,star3,star4,star5;
        TextView name,location,desc;

        inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        final View view = inflater.inflate(R.layout.viewpage, parent, false);

        // Get the position

        c = (CheckBox) view.findViewById(R.id.mycheckbox);
        name = (TextView) view.findViewById(R.id.fh_name);
        location = (TextView) view.findViewById(R.id.fh_loc);
        desc = (TextView) view.findViewById(R.id.fh_desc);
        facility1 = (ImageView) view.findViewById(R.id.fh_fc1);
        facility_1 = (ImageView) view.findViewById(R.id.fh_fc11);
        facility2 = (ImageView) view.findViewById(R.id.fh_fc2);
        facility_2 = (ImageView) view.findViewById(R.id.fh_fc22);
        facility3 = (ImageView) view.findViewById(R.id.fh_fc3);
        facility_3 = (ImageView) view.findViewById(R.id.fh_fc33);
        facility4 = (ImageView) view.findViewById(R.id.fh_fc4);
        facility_4 = (ImageView) view.findViewById(R.id.fh_fc44);
        star1 = (ImageView) view.findViewById(R.id.fh_s1);
        star2 = (ImageView) view.findViewById(R.id.fh_s2);
        star3 = (ImageView) view.findViewById(R.id.fh_s3);
        star4 = (ImageView) view.findViewById(R.id.fh_s4);
        star5 = (ImageView) view.findViewById(R.id.fh_s5);
        image_path = (ImageView) view.findViewById(R.id.image_all_main);

        c.setOnClickListener( new View.OnClickListener() {
            public void onClick(View v) {

                if(c.isChecked() && checkCounter >=3) {
                    AllMenu.get(position).setSelected(false);
                    c.setChecked(false);
                    Toast.makeText(context, "You can select max 3 hotels!!", Toast.LENGTH_SHORT).show();
                }
                else {
                    Product p = (AllMenu).get(position);
                    p.setSelected(c.isChecked());
                    if(c.isChecked()) {
                    checkCounter++;
                    }
                    else {
                        checkCounter--;
                    }
                }

                StringBuffer responseText = new StringBuffer();
                responseText.append("The following were selected...");

                ArrayList<Product> p = AllMenu;
                for(int i=0;i<p.size();i++){
                    Product pp = p.get(i);
                    if(pp.isSelected()){
                        responseText.append("\n" + pp.getName() + "\t");
                        responseText.append("\t" + pp.getLocation());

                    }
                }

                Toast.makeText(context,
                        responseText, Toast.LENGTH_SHORT).show();

            }
        });



        c.setTag(tempMenu);
        c.setChecked(tempMenu.isSelected());
        name.setText(tempMenu.getName());
        location.setText(tempMenu.getLocation());
        desc.setText(tempMenu.getDescription());
        imageLoader.DisplayImage(tempMenu.getImage_path(),image_path);
        if(tempMenu.getFacility1().equals("Pool")) {
            facility1.setVisibility(view.VISIBLE);
            facility_1.setVisibility(view.INVISIBLE);
        }else {
            facility_1.setVisibility(view.VISIBLE);
            facility1.setVisibility(view.INVISIBLE);
        }

        if(tempMenu.getFacility2().equals("Bar")) {
            facility2.setVisibility(view.VISIBLE);
            facility_2.setVisibility(view.INVISIBLE);
        }else {
            facility_2.setVisibility(view.VISIBLE);
            facility2.setVisibility(view.INVISIBLE);
        }

        if(tempMenu.getFacility3().equals("Gym")) {
            facility3.setVisibility(view.VISIBLE);
            facility_3.setVisibility(view.INVISIBLE);
        }else {
            facility_3.setVisibility(view.VISIBLE);
            facility3.setVisibility(view.INVISIBLE);
        }

        if(tempMenu.getFacility4().equals("Theater")) {
            facility4.setVisibility(view.VISIBLE);
            facility_4.setVisibility(view.INVISIBLE);
        }else {
            facility_4.setVisibility(view.VISIBLE);
            facility4.setVisibility(view.INVISIBLE);
        }

        if(tempMenu.getStar().equals("1")) {
            star1.setVisibility(view.VISIBLE);
            star2.setVisibility(view.INVISIBLE);
            star3.setVisibility(view.INVISIBLE);
            star4.setVisibility(view.INVISIBLE);
            star5.setVisibility(view.INVISIBLE);
        }else if(tempMenu.getStar().equals("2")) {
            star1.setVisibility(view.VISIBLE);
            star2.setVisibility(view.VISIBLE);
            star3.setVisibility(view.INVISIBLE);
            star4.setVisibility(view.INVISIBLE);
            star5.setVisibility(view.INVISIBLE);
        }else if(tempMenu.getStar().equals("3")) {
            star1.setVisibility(view.VISIBLE);
            star2.setVisibility(view.VISIBLE);
            star3.setVisibility(view.VISIBLE);
            star4.setVisibility(view.INVISIBLE);
            star5.setVisibility(view.INVISIBLE);
        }else if(tempMenu.getStar().equals("4")) {
            star1.setVisibility(view.VISIBLE);
            star2.setVisibility(view.VISIBLE);
            star3.setVisibility(view.VISIBLE);
            star4.setVisibility(view.VISIBLE);
            star5.setVisibility(view.INVISIBLE);
        }else if(tempMenu.getStar().equals("5")) {
            star1.setVisibility(view.VISIBLE);
            star2.setVisibility(view.VISIBLE);
            star3.setVisibility(view.VISIBLE);
            star4.setVisibility(view.VISIBLE);
            star5.setVisibility(view.VISIBLE);
        }
        else {
            star1.setVisibility(view.INVISIBLE);
            star2.setVisibility(view.INVISIBLE);
            star3.setVisibility(view.INVISIBLE);
            star4.setVisibility(view.INVISIBLE);
            star5.setVisibility(view.INVISIBLE);
        }
        return view;
    }
    }

After selecting item from list it will come on this activity.

    public class BookHotel extends AppCompatActivity {

    EditText arrival,departure;
    Calendar myCalendar;
    Button booknow;
    final String[] qtyValues = {"0","1","2","3","4"};
    Spinner adult,children;
    String chkin,chkout,persons,kids;
    CheckBox checkbox;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.book_hotel);

        booknow = (Button) findViewById(R.id.bookmyhotel);

        arrival = (EditText) findViewById(R.id.arrival_date);
        departure = (EditText) findViewById(R.id.departure_date);
        myCalendar = Calendar.getInstance();


        adult = (Spinner) findViewById(R.id.adults);
        children = (Spinner) findViewById(R.id.childrens);

        booknow.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(arrival.getText().length() <= 0){
                    arrival.setError("Please fill the field.!!");
                }else if(departure.getText().length() <= 0){
                    departure.setError("Please fill the field.!!");
                }else {
                    chkin = arrival.getText().toString();
                    chkout = departure.getText().toString();
                    persons = adult.getSelectedItem().toString();
                    kids = children.getSelectedItem().toString();
                    //Submit(chkin, chkout, persons, kids);
                }
            }
        });

        ArrayAdapter<String> aa=new ArrayAdapter<String>(getApplicationContext(),R.layout.qty_spinner_item,qtyValues);
        aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        adult.setAdapter(aa);
        children.setAdapter(aa);

        final DatePickerDialog.OnDateSetListener adate = new DatePickerDialog.OnDateSetListener() {

            @Override
            public void onDateSet(DatePicker view, int year, int monthOfYear,
                                  int dayOfMonth) {
                // TODO Auto-generated method stub
                myCalendar.set(Calendar.YEAR, year);
                myCalendar.set(Calendar.MONTH, monthOfYear);
                myCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
                updateArrival();
            }

        };

        final DatePickerDialog.OnDateSetListener ddate = new DatePickerDialog.OnDateSetListener() {

            @Override
            public void onDateSet(DatePicker view, int year, int monthOfYear,
                                  int dayOfMonth) {
                // TODO Auto-generated method stub
                myCalendar.set(Calendar.YEAR, year);
                myCalendar.set(Calendar.MONTH, monthOfYear);
                myCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
                updateDeparture();
            }

        };

        arrival.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                new DatePickerDialog(BookHotel.this, adate, myCalendar
                        .get(Calendar.YEAR), myCalendar.get(Calendar.MONTH),
                        myCalendar.get(Calendar.DAY_OF_MONTH)).show();
            }
        });
        departure.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                new DatePickerDialog(BookHotel.this, ddate, myCalendar
                        .get(Calendar.YEAR), myCalendar.get(Calendar.MONTH),
                        myCalendar.get(Calendar.DAY_OF_MONTH)).show();
            }
        });
    }
    private void updateArrival() {
        String myFormat = "  MM/dd/yy  "; //In which you need put here
        SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.US);
        arrival.setText(sdf.format(myCalendar.getTime()));
        //departure.setText(sdf.format(myCalendar.getTime()));
    }
    private void updateDeparture() {
        String myFormat = "  MM/dd/yy  "; //In which you need put here
        SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.US);
        //arrival.setText(sdf.format(myCalendar.getTime()));
        departure.setText(sdf.format(myCalendar.getTime()));
    }
    }

I don't know how i can pass those selecting item and this info to server on onClickListener please help me solve this problem. Thank You 
And here is another problem i will posted on it is [this][1]


  [1]: http://stackoverflow.com/questions/38142573/how-to-retrieve-particular-user-information-from-server-when-user-get-logged-in