title: Cannot resolve symbol 'context'
body: <p>I'm trying to write an Android app which automatically uploads a picture to a server, but I am stuck on just one line of code: </p>
  
  <pre><code>        File f = File(context.getCacheDir(), "filename");
  </code></pre>
  
  <p>The error I get is 
  <img src="https://i.stack.imgur.com/whTVQ.png" alt="enter image description here"></p>
  
  <p>This puzzles me because I see so many examples on the web of people using <code>context.getCacheDir()</code> just fine, whereas I get the error message.
  It's probably something wrong with my IDE settings. I am using IntelliJ IDE.</p>
  
  <p>Here's is the context of the context problem:</p>
  
  <pre><code>    @Override
      public void onActivityResult(int requestCode, int resultCode, Intent data)
      {
          super.onActivityResult(requestCode, resultCode, data);
          if( requestCode == CAMERA_PIC_REQUEST)
          {
              Bitmap thumbnail = (Bitmap) data.getExtras().get("data");
              ImageView image =(ImageView) findViewById(R.id.PhotoCaptured);
              image.setImageBitmap(thumbnail);
  
              //create a file to write bitmap data
              File f = File(context.getCacheDir(), "filename");
              try {
                  f.createNewFile();
              } catch (IOException e) {
                  e.printStackTrace();
              }
  </code></pre>