title: convert a cardview to bitmap
body: <p>similar type of questions has been asked several times, but I am still having a tough time to understand where the image is saved. I am using the accepted solution of <a href="https://stackoverflow.com/questions/7200535/how-to-convert-views-to-bitmaps">this SO question</a>.</p>
  
  <p>I have a <code>cardview</code> that I want to convert to an image and share it(that's a different issue).
  My cardview is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  ......
  android.support.v7.widget.CardView
          android:id="@+id/cv_abtme"
          android:layout_width="368sp"
          android:layout_height="273dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="101dp"
          android:background="@color/colorPrimaryLight"
          app:cardBackgroundColor="@color/about_instagram_color"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"&gt;
  
  
          &lt;ImageView
              android:id="@+id/imageView4"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:adjustViewBounds="true"
              android:scaleType="centerCrop"
              app:srcCompat="@mipmap/ic_launcher" /&gt;
          ....
  
      &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p>I am trying to convert it as:</p>
  
  <pre><code>public class AboutMeActivity extends AppCompatActivity {
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_about_me);
          ImageButton cvbutton= findViewById(R.id.imageButton_abtme);
  
  
          cvbutton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  getBitmapFromView(view);
                  Snackbar.make(getCurrentFocus(),"Image Captured", Snackbar.LENGTH_LONG).show();
              }
          });
      }
      public static Bitmap getBitmapFromView(View view) {
          Bitmap returnedBitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(),Bitmap.Config.ARGB_8888);
          Canvas canvas = new Canvas(returnedBitmap);
          Drawable bgDrawable =view.getBackground();
          if (bgDrawable!=null)
              bgDrawable.draw(canvas);
          else
              canvas.drawColor(Color.WHITE);
          view.draw(canvas);
          return returnedBitmap;
      }
  }
  </code></pre>
  
  <p>But I have no idea how it's working, as I can't see any image produced, but obviously no error.</p>
  
  <p>So, the question is:</p>
  
  <ol>
  <li>What is the path the image created?</li>
  <li>Do I need some permission to save and access the jpg?</li>
  </ol>