title: How to put close button at top corner in alert dialog box for android?
body: <p>How to put close button at top corner in alert dialog box for android?</p>
  
  <p>put close button at right side top corner in alert dialog.</p>
  
  <p>i have used below code for scroll and dialog box</p>
  
  <pre><code>&lt;ScrollView 
          android:id="@+id/ScrollView01" 
          android:layout_width="fill_parent" 
          android:layout_height="fill_parent" 
          xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical"
     android:scrollbars="vertical" 
     android:scrollbarAlwaysDrawVerticalTrack="true" &gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;ImageVieandroid:id="@+id/image"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:layout_alignParentRight="true"
   android:layout_alignParentTop="true"
   android:layout_marginLeft="200dp"
   android:src="@drawable/ic_launcher" /&gt;
  
  &lt;/RelativeLayout&gt;
  
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>in java coding i have used below coding
  i want to put a image to close the dialog box
  please help</p>
  
  <pre><code>public void onClick(View v) 
  {
  // TODO Auto-generated method stub
     switch (v.getId())
     {
      case R.id.How_to_use:
  
   final Dialog dialog = new Dialog(this);
   dialog.setContentView(R.layout.description);
   dialog.setTitle("How to use");
   TextView text = (TextView) dialog.findViewById(R.id.description);
   text.setText(R.string.Descr_How_to_use);
   ImageView image = (ImageView) dialog.findViewById(R.id.image);
   image.setImageResource(R.drawable.ic_launcher);
   image.setOnClickListener(new OnClickListener() 
   {
    // @Override
    public void onClick(View v) {
    dialog.dismiss();
    }
    });
   dialog.show();
   break;
   default:
   break;
   }
  </code></pre>