title: getcontentresolver() is undefined for the type
body: <p>Hi I am very new to java and am trying to create an app to upload pictures from my phones memory. I am trying to upload an image from my gallery to my app, I am getting the error "The method getConstentResolver() is undefined for the type Upload" How can I fix this?</p>
  
  <p>Below is my code...</p>
  
  <pre><code>public class Upload extends Fragment {
  
      private static final int SELECTED_PICTURE=1;
      ImageView iv;
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
  
          View rootView = inflater.inflate(R.layout.upload, container, false);
  
          iv=(ImageView)rootView.findViewById(R.id.imageView1);
  
          return rootView;
  
      }
  
      public void btnClick(View v){
          Intent i=new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
          startActivityForResult(i, SELECTED_PICTURE);
  
      }
  
      @Override
      public void onActivityResult(int requestCode, int resultCode, Intent data){
          super.onActivityResult(requestCode,resultCode,data);
          switch(requestCode){
          case SELECTED_PICTURE:
              if(resultCode==RESULT_OK){
                  Uri uri =data.getData();
                  String[]projection={MediaStore.Images.Media.DATA};
  
                  Cursor cursor=getConstentResolver().query(uri,projection,null,null,null);
                  cursor.moveToFirst();
                  int columnIndex=cursor.getColumnIndex(projection[0]);
                  String filePath=cursor.getString(columnIndex);
                  cursor.close();
  
                  Bitmap yourSelectedImage=BitmapFactory.decodeFile(filePath);
                  Drawable d=new BitmapDrawable(yourSelectedImage);
                  iv.setBackground(d);
  
  
              }
                      }
      }
  
  
      }
  </code></pre>