title: Android - Capture ScreenShot Programmatically without title bar
body: <p>I am developing an app in that I want to take a screen shot of current screen but with out title bar. I know the code to Capture a ScreenShot, but unable to customize it.</p>
  
  <p>Code:</p>
  
  <pre><code>munchscreen.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  View v1 = L1.getRootView();
                  v1.setDrawingCacheEnabled(true);
                  Bitmap bm = v1.getDrawingCache();
                  BitmapDrawable bitmapDrawable = new BitmapDrawable(bm);
                  image = (ImageView) findViewById(R.id.screenshots);
                  image.setBackgroundDrawable(bitmapDrawable);
              }
          });
  </code></pre>
  
  <p>When I click on <code>Clip</code> then it should capture a screen shot of the screen shown below but should not include the part which I have circled..</p>
  
  <p><strong>XML:</strong> </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="#D8D5AA"
  &gt;
  
  
    &lt;LinearLayout 
      android:id="@+id/clip_from_web_linearlayout1"
      android:layout_width="match_parent"
      android:layout_height="50dp"
      android:background="@drawable/header"
      android:orientation="horizontal"             
      &gt;
           &lt;TextView 
          android:id="@+id/clip_from_web_textview_back"
          android:layout_height="wrap_content"
          android:layout_width="wrap_content"
          android:text="Back"
          android:layout_gravity="center"
          android:layout_marginLeft="5dp"
          android:textColor="#FFFFFF"
          android:textSize="18sp"
          /&gt; 
  
      &lt;TextView 
          android:id="@+id/clip_from_web_textview_header_title"
          android:layout_height="wrap_content"
          android:layout_width="wrap_content"
          android:text="Clip From Web"
          android:layout_gravity="center"
          android:layout_marginLeft="60dp"
          android:textColor="#FFFFFF"
          android:textSize="18sp"
          /&gt; 
  
        &lt;TextView 
          android:id="@+id/clip_from_web_textview_clip"
          android:layout_height="wrap_content"
          android:layout_width="wrap_content"
          android:text="Clip"
          android:layout_gravity="center"
          android:layout_marginLeft="60dp"
          android:textColor="#FFFFFF"
          android:textSize="18sp"
          /&gt; 
  
      &lt;/LinearLayout&gt;
  
  
            &lt;Button
               android:layout_width="fill_parent"
               android:layout_height="wrap_content"
               android:text="@string/munch"
               android:id="@+id/munchscreen"
               android:layout_below="@+id/clip_from_web_linearlayout1"
             /&gt;
             &lt;ImageView
               android:layout_width="200dp"
               android:layout_height="200dp"
               android:id="@+id/screenshots"
               android:layout_below="@+id/munchscreen"
               android:contentDescription="@string/app_name"
               android:layout_centerInParent="true"
  
               /&gt;
  
  &lt;RelativeLayout
      android:id="@+id/clip_from_web_bottom_bar"
      android:layout_width="match_parent"
      android:layout_height="50dp"
      android:layout_alignParentBottom="true"
      android:background="@drawable/header" &gt;
  
      &lt;Button 
          android:id="@+id/clip_from_web_previous"
          android:layout_width="40dp"
          android:layout_height="40dp"
          android:layout_marginLeft="4dp"
          android:background="@android:drawable/ic_media_previous"
          android:layout_marginTop="2dp"
          /&gt;
  
      &lt;Button 
          android:id="@+id/clip_from_web_reload"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerHorizontal="true"
          android:background="@android:drawable/ic_menu_rotate"
          android:layout_marginTop="5dp"
          /&gt;
  
      &lt;Button 
          android:id="@+id/clip_from_web_next"
          android:layout_width="40dp"
          android:layout_height="40dp"
          android:layout_toRightOf="@+id/clip_from_web_reload"
          android:layout_marginLeft="102dp"
          android:background="@android:drawable/ic_media_next"
          android:layout_marginTop="2dp"
          /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>Image before Capturing screen shot..</p>
  
  <p><img src="https://i.stack.imgur.com/TCz3n.png" alt="enter image description here"></p>
  
  <p>Image after Capturing screen shot..</p>
  
  <p><img src="https://i.stack.imgur.com/SbWwk.png" alt="enter image description here"></p>