title: pick image from gallery and display in imagae view
body: <p>this my code its not working how pick up image from gallery and display in imageview</p>
  
  <pre><code>public class MainActivity extends ActionBarActivity {
      Button imageUpload;
      ImageView imageView;
      static final int PICTURE = 1;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          imageView= (ImageView) findViewById(R.id.imageView);
          imageUpload= (Button) findViewById(R.id.buttonImage);
          imageUpload.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
                  startActivityForResult(intent,PICTURE);
  
              }
          });
      }
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
  
          switch (requestCode)
          {
              case PICTURE:
                  if(requestCode==RESULT_OK){
  
                      Uri uri = data.getData();
                      String[] prjection ={MediaStore.Images.Media.DATA};
                      Cursor cursor=getContentResolver().query(uri,prjection,null,null,null);
                      cursor.moveToFirst();
  
                      int columnIndex=cursor.getColumnIndex(prjection[0]);
                      String path=cursor.getString(columnIndex);
                      cursor.close();
  
                      Bitmap selectFile = BitmapFactory.decodeFile(path);
                      Drawable d = new BitmapDrawable(selectFile);
                      imageView.setBackground(d);
                  }
          }
  
      }
  </code></pre>
  
  <p>hello friends i am new in android i required this type of apps to  upload image and display in imageview plz help me if have idea.thanks in advance </p>