I want to close this android dialogbox after click on listitem :     button2.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                final AlertDialog.Builder alertDialog = new AlertDialog.Builder(PersonalizeSettingsActivity.this);
                LayoutInflater inflater = getLayoutInflater();
                View convertView = (View) inflater.inflate(R.layout.custom, null);
                alertDialog.setView(convertView);
                alertDialog.setTitle("Branches");
                ListView lv = (ListView) convertView.findViewById(R.id.listView1);
                ListViewAdapterBranch adapter = new ListViewAdapterBranch(branchList, getApplicationContext());
                lv.setAdapter(adapter);
                lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                    @Override
                    public void onItemClick(AdapterView<?> parent, View view,int position, long id) {
                        Branch branch = branchList.get(position);
                        button2.setText("Branch: "+branch.getName());
                   

                    }
                });
                alertDialog.show();
            }
        });
here branch list contain the list of item.
now i want to hide or close this custom dialog box when i click on the list item