How can I dismiss the dialog?
<pre><code>                AlertDialog.Builder fpdialog = new AlertDialog.Builder(context);
                ListView fpathlist = new ListView(context);
                ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(context,android.R.layout.simple_expandable_list_item_1, fpathdata());
                OnItemClickListener listener = new OnItemClickListener() {

                    public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                            final int position, long arg3) {
                        // TODO Auto-generated method stub
                        for (int i=0;i&lt;=position;i++)
                        {
                            if (i==position)
                            {
                                CharSequence[] pathString = {"在地图显示","发短信","共享","删除"};
                                final AlertDialog.Builder pathlist = new AlertDialog.Builder(context);
                                pathlist.setTitle("路线收藏");
                                pathlist.setItems(pathString, new DialogInterface.OnClickListener() {

                                    public void onClick(DialogInterface dialog, int which) {
     //Here I want to dismiss the fpdialog                                  
                                    }});
                                pathlist.show();
                            }
                        }
                    }
                };
                fpathlist.setOnItemClickListener(listener);
                fpathlist.setAdapter(adapter);
                fpdialog.setView(fpathlist);
                fpdialog.show();
</code></pre>
