title: cannot resolve symbol getContext
body: <p>I am new to android/java programming and I am having an issue with getting an error saying that the symbol<code>getContext</code> cannot be resolved, I am trying to get the pictures from my app to save to the photo gallery on the phones primary external storage. If anyone could help me out with this error I would be very grateful for any input:</p>
  
  <pre><code>public void saveImage(){
      String fileName="Site" + System.currentTimeMillis();
      ContentValues values=new ContentValues();
      values.put(MediaStore.Images.Media.TITLE,fileName);
      values.put(MediaStore.Images.Media.DATE_ADDED,System.currentTimeMillis());
      values.put(MediaStore.Images.Media.MIME_TYPE,"image/jpg");
      Uri uri=getContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,values);
      try {
          OutputStream outStream=getContext().getContentResolver().openOutputStream(uri);
          bitmap.compress(Bitmap.CompressFormat.JPEG,100,outStream);
          outStream.flush();
          outStream.close();
          Toast message=Toast.makeText(getContext(),R.string.message_saved,Toast.LENGTH_SHORT);
          message.setGravity(Gravity.CENTER,message.getXOffset() / 2,message.getYOffset() / 2);
          message.show();
      }
      catch (  IOException ex) {
          Toast message=Toast.makeText(getContext(),R.string.message_error_saving,Toast.LENGTH_SHORT);
          message.setGravity(Gravity.CENTER,message.getXOffset() / 2,message.getYOffset() / 2);
          message.show();
      }
  </code></pre>