title: Sceenshot View have some error: Layout cannot be found
body: <p>i try to sceenshot <code>View</code>  but <code>R.id.layout</code> cannot be resolved or is not a field</p>
  
  <p>and i try to  <code>import com.example.mye_card.R;</code> then clean up  but not work</p>
  
  <pre><code>    btnsave.setOnClickListener(new OnClickListener() {
          public void onClick(View v) {
  
              View v2 = findViewById(R.id.layout);
              v2.setDrawingCacheEnabled(true);
              Bitmap bmp = Bitmap.createBitmap(v2.getDrawingCache());
              v2.setDrawingCacheEnabled(false);
  
              try {
                  Date d = new Date();
                  String filename  = (String)DateFormat.format("kkmmss-MMddyyyy"
                      , d.getTime());
                  File dir = new File(Environment.getExternalStorageDirectory(), "/Pictures/" + filename );
                  FileOutputStream out = new FileOutputStream(dir);
                  ByteArrayOutputStream bos = new ByteArrayOutputStream();
                  bmp.compress(Bitmap.CompressFormat.JPEG, 100, bos);
                  out.write(bos.toByteArray());
                  Toast.makeText(getApplicationContext(), "Save card!", Toast.LENGTH_SHORT).show();
              } catch (FileNotFoundException e) {
                  e.printStackTrace();
              }  catch (IOException e) {
                  e.printStackTrace();
              }
          }
      });
  </code></pre>
  
  <p>error line</p>
  
  <pre><code>View v2 = findViewById(R.id.layout);
  </code></pre>
  
  <p>about import</p>
  
  <pre><code>package com.example.mye_card;
  import java.io.ByteArrayOutputStream;
  import java.io.File;
  import java.io.FileNotFoundException;
  import java.io.FileOutputStream;
  import java.io.IOException;
  import java.util.Date;
  </code></pre>