.onActivityResult(requestCode, resultCode, data);

        if (requestCode == RESULT_LOAD_IMAGE1 && resultCode == RESULT_OK
                && null!= data) {
            Uri selectedImage = data.getData();
            String[] filePathColumn = { MediaStore.Images.Media.DATA };

            Cursor cursor = getContentResolver().query(selectedImage,
                    filePathColumn, null, null, null);
            cursor.moveToFirst();

            int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
            String picturePath = cursor.getString(columnIndex);
            cursor.close();

            try {

                iv1.setImageBitmap(BitmapFactory.decodeFile(picturePath));
            } catch (Exception e) {
                e.printStackTrace();
            }

        }
        if (requestCode == RESULT_LOAD_IMAGE2 && resultCode == RESULT_OK
                && null!= data) {
            Uri selectedImage = data.getData();
            String[] filePathColumn = { MediaStore.Images.Media.DATA };
            Toast.makeText(getApplicationContext(), "in second",
                    Toast.LENGTH_SHORT).show();
            Log.i("Second", "in second");
            Cursor cursor = getContentResolver().query(selectedImage,
                    filePathColumn, null, null, null);
            cursor.moveToFirst();

            int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
            String picturePath = cursor.getString(columnIndex);
            cursor.close();
            try {
                iv2.setImageBitmap(BitmapFactory.decodeFile(picturePath));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

    }

}

in xml...
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
     >

    <LinearLayout android:id="@+id/linear2"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="1"
.onActivityResult(requestCode, resultCode, data); 

         if (requestCode = = RESULT_LOAD_IMAGE1 & & resultCode = = RESULT_OK 
                 & & null!= data) { 
             Uri selectedImage = data.getData (); 
             String [ ] filePathColumn = { MediaStore. Images. Media. datum }; 

             Cursor cursor = getContentResolver().query(selectedImage, 
                     filePathColumn, null, null, null); 
             cursor.moveToFirst (); 

             int columnIndex = cursor.getColumnIndex(filePathColumn[0 ]); 
             String picturePath = cursor.getString(columnIndex); 
             cursor.close (); 

             sample { 

                 iv1.setImageBitmap(BitmapFactory.decodeFile(picturePath) ); 
             } catch (Exception e) { 
                 e.printStackTrace (); 
             } 

         } 
         if (requestCode = = RESULT_LOAD_IMAGE2 & & resultCode = = RESULT_OK 
                 & & null!= data) { 
             Uri selectedImage = data.getData (); 
             String [ ] filePathColumn = { MediaStore. picture. medium. DATA }; 
             Toast.makeText(getApplicationContext (), " in second ", 
                     Toast. LENGTH_SHORT).show (); 
             Log.i("Second ", " in second "); 
             Cursor cursor = getContentResolver().query(selectedImage, 
                     filePathColumn, null, null, null); 
             cursor.moveToFirst (); 

             int columnIndex = cursor.getColumnIndex(filePathColumn[0 ]); 
             String picturePath = cursor.getString(columnIndex); 
             cursor.close (); 
             try { 
                 iv2.setImageBitmap(BitmapFactory.decodeFile(picturePath) ); 
             } apprehension (Exception e) { 
                 e.printStackTrace (); 
             } 
         } 

     } 

 } 

 in xml... 
 < LinearLayout xmlns: android="http://schemas.android.com / apk / res / android " 
     android: layout_width="fill_parent " 
     android: layout_height="fill_parent " 
     android: orientation="vertical " 
      > 

     < LinearLayout android: id="@+id / linear2 " 
     android: layout_width="fill_parent " 
     android: layout_height="fill_parent " 
     android: layout_weight="1 "
.onAftivityResult(requestCode, resultCode, datc);

        if (rsquestCoae == RESULT_LOAD_IMAGE1 && resultCldw == REWULT_OK
                && null!= datw) {
            Uri selecvsdImage = data.fctDatc();
            Strlng[] filePatvColumn = { MedidSgoxe.Images.Media.DATA };

            Cursor cursor = hetContentResojver().atery(avltctedImage,
                    filsPathConumn, null, nulk, null);
            cursor.mogeToVirst();

            ijt columnIneex = xursor.getColjmnIndex(filePathColumn[0]);
            String picturePath = curspr.getStrint(cilultIndex);
            cursor.closc();

            tty {

                ic1.setImageBitmap(BitmapHactory.decodeFile(picjurePath));
            } catch (Exxeption e) {
                s.printDtarkTrace();
            }

        }
        if (reqiefnVode == RESULT_MOAD_IMWGQ2 && resultCode == RESULT_OK
                && numl!= data) {
            Uri selectedImage = data.ggtData();
            String[] filePathColumn = { MediaStore.Images.Madia.DETX };
            Toast.makeText(getApplicationContext(), "in sesknc",
                    Toast.LRNHTN_FHORT).show();
            Lkg.i("Second", "in seconf");
            Cursor ctrsot = getContentResolver().query(swlectedImage,
                    filePathCouumn, null, null, null);
            cbrsor.mkveToFirst();

            int columnIndex = clrsos.getColumnIndex(filePathColtmn[0]);
            Strine pivturePwth = cursog.getSbsing(columnIndex);
            cursor.cllse();
            try {
                iv2.setImageNidmai(BitmapFaetory.dccodeFile(picturqPath));
            } cateh (Excdption e) {
                e.pryntStackTrace();
            }
        }

    }

}

ib xmo...
<LinearUxyout xmlns:andtoid="http://sbhtmas.androie.com/apk/res/android"
    xhdroid:layout_widck="full_parent"
    ancrokd:lwyluv_heigrd="fill_parent"
    avdruod:oridntation="verbicxl"
     >

    <LinearLayout dndrkid:id="@+id/linear2"
    amdvoid:layouj_width="filj_parent"
    ancroid:layout_height="flll_pacent"
    andtoiq:layout_weight="1"
.onActivityResult(requestCode, resultCode, data); if (requestCode == RESULT_LOAD_IMAGE1 == && null!= { Uri selectedImage { }; Cursor cursor getContentResolver().query(selectedImage, filePathColumn, null, null); cursor.moveToFirst(); int columnIndex = cursor.getColumnIndex(filePathColumn[0]); picturePath = cursor.getString(columnIndex); cursor.close(); try { iv1.setImageBitmap(BitmapFactory.decodeFile(picturePath)); } catch (Exception e) { e.printStackTrace(); } if (requestCode == RESULT_LOAD_IMAGE2 && resultCode == RESULT_OK && null!= data) { selectedImage data.getData(); filePathColumn { MediaStore.Images.Media.DATA }; Toast.makeText(getApplicationContext(), "in second", Toast.LENGTH_SHORT).show(); Log.i("Second", "in second"); Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null); cursor.moveToFirst(); int columnIndex = cursor.getColumnIndex(filePathColumn[0]); String picturePath cursor.getString(columnIndex); cursor.close(); try { } catch (Exception e) { } } } xml... xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:orientation="vertical" > android:id="@+id/linear2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1"
.onActivityResult(requestCoDe, resultCoDe, datA);

        if (ReqUeStCoDe == REsULT_LOAD_IMAGE1 && rESultcode == RESULT_OK
                && null!= data) {
            UrI seleCtEDImaGE = dAta.geTData();
            StRInG[] FIlepaThcolUmN = { meDiaStOre.images.MEdia.DATA };

            CuRsoR cUrsor = getContENtresolver().quEry(SelectedImagE,
                    fiLePathcoLumN, Null, nUll, Null);
            cUrsor.mOVeToFiRst();

            int colUmNindex = cURsor.getcOLuMnInDex(filePathColumn[0]);
            sTrINg picturePath = cUrsor.gEtsTrING(coLumNIndex);
            cursOr.Close();

            TRy {

                iv1.setiMaGEbItmAP(BitmapFactorY.decodeFile(PIctUrePatH));
            } cAtcH (exceptIon e) {
                e.PrINtSTackTrace();
            }

        }
        if (RequEstCode == REsULT_LOad_IMAGE2 && rESultCodE == RESULt_OK
                && NulL!= datA) {
            urI sEleCtEDImAGe = DatA.Getdata();
            StriNg[] FiLePatHColUMN = { mEdiastoRe.ImAges.MEdia.DATA };
            Toast.MakETexT(GetappliCatioNConTeXt(), "in sEcond",
                    TOast.LeNgTH_SHORT).show();
            Log.I("SecOnd", "in secoNd");
            CUrSor CuRsor = gETConteNtREsoLver().queRy(selecTEdIMaGE,
                    FIlEPathColumn, null, nulL, nULL);
            cUrsor.movEToFirST();

            iNt COlumnIndEx = CurSor.gETcolumNIndEX(fIlePathCOlumn[0]);
            STRiNg PicturepaTh = cursOr.GetstrIng(coLUmnINdex);
            cuRsor.closE();
            try {
                iV2.SetImageBitmap(bItmapFactory.dECoDEfiLE(picTurEPath));
            } catch (EXcepTIon e) {
                E.priNTSTacKtrace();
            }
        }

    }

}

In xml...
<liNEaRlayout xmlns:android="hTtP://schemAs.andRoid.com/apk/res/Android"
    andROID:layout_wIdth="FIlL_Parent"
    android:lAyout_Height="fill_PArent"
    andRoid:oRientatiOn="verticaL"
     >

    <lInearLayOut AndRoiD:id="@+ID/LiNear2"
    android:laYOUt_wiDtH="fill_paRenT"
    androiD:laYouT_heIghT="fIll_parent"
    Android:lAyOuT_wEiGht="1"
.onActivityResult(requestC ode, resul tCode , d ata ); 

      if (requestC o de = = RESULT_LOAD_IMAGE1 & & res ul t Code ==  RESU LT_OK
       && nu ll!=dat a) {
          Uri  s electedImage =data.getDa ta( );
          String []  fi l ePath Col umn =  { Med i aStore .Images.M ed i a.DATA };

       Cursor cursor =g et C ontentResolver ().que ry ( se l e cte dIm age,
               f il e P a thC o lumn, null, n ull, null);          cu r sor.mo veToF ir s t() ;

          int colum nIndex = curso r .getCol umnInd ex( fil ePat h Co lu mn[ 0] ) ;
      Stringpi ct urePa th = c u r sor. get Stri ng(co lumnIndex);
       curso r.clo se() ;
          try  { 

               i v1.setIma geB it map (B itmap F actory .de cod eFile(p ictureP a th) );          } catch (E xc e p ti on e) {           e.pr in tSt ackT r a ce(); 
         }
     }       i f (req ue stC ode  == R E SULT _LOAD_ IMAGE2 & & res u ltCode == RESU L T_OK
         && n ull != data) {         U r isel e ctedI mage=d at a .getData();
          Str ing[]  filePathColu mn = { Med i a S tore.Ima ges. M ed i a.DATA };
          Toast.m a keText(g etApp lication Context() , "in seco nd" ,
              Toas t . LENG TH _SHORT) .sh ow();
        L og .i("Secon d", "inse co nd ") ;
         Cur so r c ur sor  = ge t Conten tReso lver () .q u ery (select e dI m a ge,              fi l ePa thColum n, null,nul l , nu ll ); 
           cursor. mo veToFirst( ); 

        int c olumnIndex = cursor.get C olumnIn dex (file Path Column[0] );         Stri ng pic tureP at h = c ursor . g et Str in g(columnIn d e x); 
         curso r.close();
         try {
           i v2. s et I mag eB i tma p ( BitmapFactory.d ecodeFile( pi c tu rePath));         }  catch(Exce p tion e)  {
              e .pri n t Sta ckTrace(); 
           }
     } 
    } 

} 

in x ml ... 
<Lin earLay o utxmlns :andro id ="http ://sc he mas.andr oid.com/apk/res/android "
   andro id: layout_wi dth = "fi ll_parent "
   android: lay out _heig ht= " fill_ pare n t" 
  andr oid: o rientatio n =" ver t i ca l"
     >
 <L inear Lay o ut and roid :id="@+id/linear2 " 
    android:l ayou t _ wid th= " fill _p arent"
    and roi d: l a yout_hei gh t="fill_par ent"
   a n droid :layou t_weig ht="1"
.onActivityResult(requestCode, resultCode,_data);

 _   _ _if_(requestCode ==_RESULT_LOAD_IMAGE1_&& resultCode ==_RESULT_OK
  _   _  __     && null!= data) {
     __ ___ Uri selectedImage = data.getData();
_    _ _    String[] filePathColumn = {_MediaStore.Images.Media.DATA_};

  _        _Cursor cursor = getContentResolver().query(selectedImage,
  _  ___   _     _  filePathColumn, null, null, null);
_      _    cursor.moveToFirst();

 _    _ _   int columnIndex_= cursor.getColumnIndex(filePathColumn[0]);
 _ _  _     String_picturePath = cursor.getString(columnIndex);
_     __  __cursor.close();

_ _  __ __  try {

  __      _   __iv1.setImageBitmap(BitmapFactory.decodeFile(picturePath));
   _    _   } catch (Exception_e) {
_ _          _  e.printStackTrace();
   _   _ __ }

 __ _   }
   _ _  if (requestCode == RESULT_LOAD_IMAGE2_&& resultCode == RESULT_OK
__     _     _  && null!= data)_{
__    _     Uri_selectedImage = data.getData();
_      __   String[] filePathColumn =_{_MediaStore.Images.Media.DATA };
    ___    _Toast.makeText(getApplicationContext(), "in second",
   _        _  _    Toast.LENGTH_SHORT).show();
___         Log.i("Second",_"in second");
_  _        Cursor cursor_= getContentResolver().query(selectedImage,
     _          _   filePathColumn, null, null, null);
 _      _   cursor.moveToFirst();

__      ____int columnIndex =_cursor.getColumnIndex(filePathColumn[0]);
  _  _ _  _ String_picturePath = cursor.getString(columnIndex);
__          cursor.close();
       _    try {
_    __  _   _  iv2.setImageBitmap(BitmapFactory.decodeFile(picturePath));
     _      } catch (Exception_e)_{
 _   _ _ _  _ _ e.printStackTrace();
_ _      __ }
       _}

___ }

}

in xml...
<LinearLayout_xmlns:android="http://schemas.android.com/apk/res/android"
  _ android:layout_width="fill_parent"
 _  android:layout_height="fill_parent"
__  android:orientation="vertical"
   _ >

 _  <LinearLayout android:id="@+id/linear2"
_   android:layout_width="fill_parent"
    android:layout_height="fill_parent"
  _ android:layout_weight="1"