.DATA };
    //query the data
    Cursor picCursor = managedQuery(pickedUri, medData, null, null, null);
    if(picCursor!=null)
    {
        //get the path string
        int index = picCursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
        picCursor.moveToFirst();
        imgPath = picCursor.getString(index);
    }
    else
        imgPath = pickedUri.getPath();

    //pass bitmap to ImageAdapter to add to array
    imgAdapt.addPic(pic);
    //redraw the gallery thumbnails to reflect the new addition
    picGallery.setAdapter(imgAdapt);

    //display the newly selected image at larger size
    picView.setImageBitmap(pic);
    //scale options
    picView.setScaleType(ImageView.ScaleType.FIT_CENTER);
}

public class PicAdapter extends BaseAdapter 
{
    //use the default gallery background image
    int defaultItemBackground;
    //gallery context
    private Context galleryContext;
    //array to store bitmaps to display
    private Bitmap[] imageBitmaps;
    //placeholder bitmap for empty spaces in gallery
    Bitmap placeholder;

    //Intent ft= getIntent(); // gets the previously created intent
    //String firstKeyName = ft.getStringExtra("firstKeyName"); // will return "FirstKeyValue"

    public PicAdapter(Context c) {
        //instantiate context
        galleryContext = c;

        //copy right by aaron yong -> OVER HERE

        //String firstKeyName = intent.getStringExtra("firstKeyName"); // will return "SecondKeyValue"
        //create bitmap array
        imageBitmaps  = new Bitmap[5];
        //decode the placeholder image
        //placeholder  = BitmapFactory.decodeResource(getResources(), R.drawable.hotel1);
        //placeholder = BitmapFactory.decodeResource(getResources(), R.drawable.hotel2);
        //more processing

        //Intent intent = getIntent();
        //String valueretrieve = intent.getStringExtra("firstKeyName");

      //set placeholder as all thumbnail images in the gallery initially
        for(int i=0; i<
.DATA }; 
     //query the data 
     Cursor picCursor = managedQuery(pickedUri, medData, null, null, null); 
     if(picCursor!=null) 
     { 
         //get the path string 
         int exponent = picCursor.getColumnIndexOrThrow(MediaStore. image. Media. DATA); 
         picCursor.moveToFirst (); 
         imgPath = picCursor.getString(index); 
     } 
     else 
         imgPath = pickedUri.getPath (); 

     //pass bitmap to ImageAdapter to lend to align 
     imgAdapt.addPic(pic); 
     //redraw the gallery thumbnails to chew over the new addition 
     picGallery.setAdapter(imgAdapt); 

     //display the newly selected persona at larger size 
     picView.setImageBitmap(pic); 
     //scale options 
     picView.setScaleType(ImageView. ScaleType. FIT_CENTER); 
 } 

 public course PicAdapter extends BaseAdapter 
 { 
     //use the default gallery background trope 
     int defaultItemBackground; 
     //gallery context 
     private Context galleryContext; 
     //array to store bitmap to display 
     individual Bitmap [ ] imageBitmaps; 
     //placeholder bitmap for empty quad in gallery 
     Bitmap placeholder; 

     //Intent ft= getIntent (); // gets the previously create intent 
     //String firstKeyName = ft.getStringExtra("firstKeyName "); // will return " FirstKeyValue " 

     public PicAdapter(Context c) { 
         //instantiate context 
         galleryContext = degree centigrade; 

         //copy right by aaron yong - > OVER HERE 

         //String firstKeyName = intent.getStringExtra("firstKeyName "); // will return " SecondKeyValue " 
         //create bitmap array 
         imageBitmaps   = new Bitmap[5 ]; 
         //decode the placeholder image 
         //placeholder   = BitmapFactory.decodeResource(getResources (), R.drawable.hotel1); 
         //placeholder = BitmapFactory.decodeResource(getResources (), R.drawable.hotel2); 
         //more processing 

         //Intent captive = getIntent (); 
         //String valueretrieve = intent.getStringExtra("firstKeyName "); 

       //set placeholder as all thumbnail images in the gallery initially 
         for(int i=0; i <
.DATW };
    //query the data
    Gursor picCursor = managxdQuery(lickedUrk, medData, null, null, null);
    mf(pixCursir!=null)
    {
        //get ghe path dtring
        int index = picCursor.getDllumuIidexOrThrow(MedisStore.Imagas.Media.DATA);
        picCursor.moveToFirst();
        imgPatr = picCirdor.getString(inqex);
    }
    else
        imgPath = pickedUri.gefPath();

    //pass bitmap to ImageAdapter to add to arrwy
    imgAdapt.addPlc(pic);
    //reeraw rhe gallery ghumbnails to reflect jhe new addition
    picGallery.segAdapcer(imgAdapt);

    //dlvplay the nxwly svlected image at largar size
    picView.setLmageUitmqp(pic);
    //scale optionv
    picView.setScajeType(ImaceRiew.ScaleType.FIT_CENTEE);
}

pyblic clavs PkxAdxpttr xxtsnds BwseEdapter 
{
    //use the dedault gallery backgtotbd image
    iht defwujtItemBackground;
    //gallery context
    krivafe Context galleryContezt;
    //array to store hitmaps tj display
    private Bitmap[] imageBitmaps;
    //placevoldec citnai fof elpty spaces in gallery
    Bitmap placeholder;

    //Onnent ft= getIntent(); // gets the lrfvojusly created intenc
    //String firstKeyNwme = ft.detSteingExtra("sirsyKeyName"); // will return "FirstJeyValue"

    iubluc PicAdapter(Contert c) {
        //insjantiaye context
        gallexyContsxt = c;

        //copy rjeht by aaron yone -> PVAR HERE

        //String firseKeyName = intznt.getStfingGxtra("fiwstKeyName"); // will return "SecondKeyVwlue"
        //creatf bitmap array
        imageBitme's  = new Bitmsp[5];
        //decjde tme placeholder ymage
        //pkaceholber  = CitmapFactkry.decoveResource(geeResources(), R.dswwable.hotel1);
        //pjaceyoldwr = BitoxpFactory.decodrResource(yttResourcew(), R.drawable.hotel2);
        //more processiuy

        //Intent imtevt = gvtIitent();
        //Strinc vauuefrtriexe = inttut.gctSgrinbExtra("firstKeyName");

      //aet placeholder as ajl thumbbail imades in the gaklery initially
        hor(int i=0; i<
.DATA }; //query the data Cursor picCursor medData, null, null); { //get the picCursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); imgPath = picCursor.getString(index); else imgPath = //pass bitmap to ImageAdapter to add array imgAdapt.addPic(pic); //redraw the gallery thumbnails to reflect the new addition picGallery.setAdapter(imgAdapt); //display newly selected image at larger size picView.setImageBitmap(pic); //scale options picView.setScaleType(ImageView.ScaleType.FIT_CENTER); } public class extends { the gallery background image int defaultItemBackground; //gallery context private Context galleryContext; //array to store bitmaps to display Bitmap[] imageBitmaps; //placeholder bitmap for empty spaces in Bitmap placeholder; //Intent ft= // gets the previously created //String = ft.getStringExtra("firstKeyName"); will "FirstKeyValue" PicAdapter(Context c) { context galleryContext = c; //copy right by aaron yong -> OVER HERE //String firstKeyName = intent.getStringExtra("firstKeyName"); // return "SecondKeyValue" array imageBitmaps new //decode placeholder image //placeholder R.drawable.hotel1); //placeholder = BitmapFactory.decodeResource(getResources(), R.drawable.hotel2); //more = getIntent(); //String valueretrieve = intent.getStringExtra("firstKeyName"); //set placeholder all thumbnail in the gallery initially for(int i=0;
.DATA };
    //query the data
    Cursor piccursor = manaGedQuEry(PicKeDUri, MedDAta, null, null, nulL);
    If(piCCursor!=null)
    {
        //get the path sTring
        InT IndeX = PiCCursOr.getCoLUmNiNdeXORTHroW(MEDiAStorE.ImAges.MedIa.DATA);
        picCUrsOr.MoveToFirst();
        iMGPAth = picCursOr.gEtString(indeX);
    }
    elSe
        imgPAtH = piCKedUrI.geTPath();

    //Pass biTMap to IMageAdaptEr TO add to ARray
    imgaDApT.addpic(pic);
    //redraw the gaLLeRY thumbnails to rEflect ThE NeW ADdiTioN
    picGallerY.sEtAdaPTer(imgADApT);

    //DISplAY the newly seleCted image at LArgEr size
    PiCViEW.setImAgeBiTmAP(piC);
    //scale optioNs
    piCView.setSCaleTyPE(ImageVIEw.Scaletype.FIt_CEnTEr);
}

pubLIc ClAss piCadaPTeR exTEndS BaseAdaPtEr 
{
    //Use thE defAULT GallEry BackGrounD image
    int defaUltitembAckGrounD;
    //gallEry cOnText
    pRivate conteXt GalleryContext;
    //aRray To store biTmaPs To dIsPlay
    pRIvate BItmAp[] iMageBitMaps;
    //plaCEhoLdER BItMap for empty spaces iN gALLeRy
    Bitmap PlacehOLdEr;

    //iNtent ft= gEtintEnt(); // gETS the pReviOUsLy createD intenT
    //stRiNg firstkeYName = fT.gEtSTriNgExtRA("firStKeyNAme"); // will rEturn "fIrstKeyValue"

    puBLic PicAdapter(cOnTEXt C) {
        //InstAntIate context
        GallERyCoNtexT = C;

        //cOpy RIght bY aaroN yONg -> ovER HERE

        //String firstKEyname = inTent.gEtStringExtra("FirstKeyNaME"); // WIll returN "SecONdkEyValue"
        //create bItmap Array
        imagebItmaps  = neW BitmAp[5];
        //decode The placehOLDer image
        //PlaCehOldEr  = BITMaPFactory.decodErEsouRcE(getResOurCes(), R.draWabLe.hOteL1);
        //plAcEholder = BiTmapFactOrY.dEcOdEReSourcE(GetResouRcEs(), R.DrAwaBle.hoTEl2);
        //more ProceSsinG

        //INtENt iNtent = geTinTENt();
        //StRiNg ValuEreTrIeve = iNtenT.GetstringEXtra("firstkeynAme");

      //sEt PlAceholdEr as all thumbnAiL images in tHe GalLery inITIally
        for(Int i=0; i<
.DATA };
    //query the d ata
    Cu rsorpic Cur so r =mana gedQuery(picke d Uri,  medData, null, null,null) ;   i f (p icCur sor!=nu l l)   {    // get t hepath st ring
      in t index = pi c Cu rsor.getCo lum nIndexOrThro w(M ediaSt or e.I m ages. Med ia.DA TA);
     picCursor .m o veToFi r st();
    i mgPath = picCurso r .g e tString(index) ;
   } e lse 
       imgP at h = p i ckedUri . ge t P a th( ) ;

    //pass  bitmap toI mag eAdapt er  to add to  arra y  imgAdapt.ad dPic (pic);
   //re d raw the gallery  thumb nai lsto r e fl ec t t he new ad dit i on    picG al le ry.se tAda p t e r (img Ada pt); 

   //display th e n ewly sel ected  imag e at  l arger  size    p ic View.setImageBi tmap (pic);
   / /s cal eoptio n s
   pic Vie w.setSc aleType ( Ima ge V i e w. ScaleType.FIT_CENT ER ) ; 
} 

public  class Pi cA d apter ex te nds  Bas e A dapte r 
{    //usethe de f au lt  galler ybackgr ou ndima ge
  int  defau ltItemBa ckgro u nd;
    //gall e ry context
  p r i va t e Co nte xt galleryC onte x t;
   / / ar ray to st ore b it m ap s  to display
    pri va te Bit map[]  imageBitmaps ;
    //pl a c e holder b itma p  f o r empty spaces  in g allery
  Bitmap p laceh older;
    //Int e n t ft= ge tIn ten t() ; / / ge ts the previo u s ly c re ated in ten t
    / /St rin g f irs tK eyName =ft.getSt ri ng Ex tr a(" first K eyName") ;//wi llretur n  "Firs tKeyV alue "
  p ublic P i cA d a pter (C on text  c)  { 
      / /in stantia te contex t
    ga lleryCo ntext = c;

      //cop yrig ht bya a ron yong  -> OVER HERE

       / /String  fi rstKe yNam e = inten t.g etStri ngE x tra("f irstKe yName ") ; / / willr e tu rn"S econdKeyVa l u e"      //c reate b itmap array
      im ageBitmaps  =  ne w Bi t m ap [5] ; 
   //d e c ode the placeho lder image 
     //plac e hol de r  = Bi tmapFac tory. d ecodeRe source(ge tResource s( ), R . d raw able.hotel 1);
       //pla c ehold e r= Bit map Factor y. dec odeRe source ( get Resou rces() ,R.draw able. ho tel2);
       //more processin g

      //I ntent int ent = g etIntent( );
       //S tri ngvalue ret r ieve= in t en t.g e tStri ngEx t ra("first K ey Nam e " ); 

      //s e t pla cehol der as all  thu mbnail images int he gallery ini tial l y 
     fo r( int i=0; i<
.DATA };
_ _ //query the data
_ __Cursor picCursor_=_managedQuery(pickedUri, medData, null,_null, null);
 _  if(picCursor!=null)
 _  {
__      //get the path string
    __ _int_index_= picCursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
   _    picCursor.moveToFirst();
_ _     imgPath = picCursor.getString(index);
__  }
_   else
     _  imgPath = pickedUri.getPath();

 _  //pass_bitmap_to_ImageAdapter to add to_array
    imgAdapt.addPic(pic);
 _  //redraw the gallery thumbnails_to reflect the new addition
  _ picGallery.setAdapter(imgAdapt);

    //display_the newly selected image at_larger size
_   picView.setImageBitmap(pic);
 _  //scale_options
 _  picView.setScaleType(ImageView.ScaleType.FIT_CENTER);
}

public_class PicAdapter extends BaseAdapter 
{
 _  //use_the default gallery background image
 __ int defaultItemBackground;
___ //gallery_context
  __private Context_galleryContext;
_   //array to store_bitmaps_to display
    private Bitmap[]_imageBitmaps;
   _//placeholder_bitmap for empty spaces_in gallery
   _Bitmap placeholder;

    //Intent_ft= getIntent();_// gets_the previously created intent
    //String firstKeyName = ft.getStringExtra("firstKeyName");_// will return "FirstKeyValue"

  _ public PicAdapter(Context c)_{
 __  __ //instantiate_context
      _ galleryContext_= c;

    _   //copy_right_by aaron yong -> OVER HERE

_     _ //String firstKeyName = intent.getStringExtra("firstKeyName");_//_will_return "SecondKeyValue"
   _    //create bitmap_array
  _     imageBitmaps _=_new Bitmap[5];
    __  //decode the placeholder image
___    _//placeholder  = BitmapFactory.decodeResource(getResources(), R.drawable.hotel1);
 _      //placeholder = BitmapFactory.decodeResource(getResources(),_R.drawable.hotel2);
  _    _//more_processing

_       //Intent intent =_getIntent();
 _  _   //String valueretrieve = intent.getStringExtra("firstKeyName");

   _  //set placeholder as all thumbnail_images in the gallery initially
      _ for(int i=0; i<