        //googlemap.clear();
        marker = new MarkerOptions().position(
                new LatLng(user_latlongobj2.user_latitude,
                        user_latlongobj2.user_longitude)).title(
                LoginDetails.Address);

        System.out.println("This is the Address" + LoginDetails.Address);

        marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker));

        if (googlemap!= null) {

            googlemap.addMarker(marker).showInfoWindow();
        }else {
            intialiseMap();
            googlemap.addMarker(marker).showInfoWindow();
        }
        System.out.println("PLACING MARKER" + LoginDetails.Address);
        if (marker == null || contextPlace == null) {
            Intent in =new Intent(this,ProfileActivity1.class);
            in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            in.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(in);
        }
        else
            fixmarker(marker, contextPlace);

    } catch (Exception e) {
        fixmarker(marker, contextPlace);
        Log.d("Profileactivity", "" + e);
    }

}

This is how we initialise Map
private void intialiseMap() {

try {
if (dialog == null)
    dialog = ProgressDialog.show(ProfileActivity1.this, "",
            getString(R.string.getting_location), true, true);
}catch(Exception e) {
Log.e("eybaba",""+e);
}
    try {
        if (googlemap == null) {
            googlemap = ((MapFragment) getFragmentManager()
                   .findFragmentById(R.id.mapfragment)).getMap();
            googlemap.setInfoWindowAdapter(new CustomInfowindow(context));
            // check if map is created successfully or not
            if (googlemap == null) {
                Toast.makeText(getApplicationContext(),
                        R.string.maps_create_error, Toast.LENGTH_SHORT)
                       .show();
            }
        }
    }
//googlemap.clear (); 
         marker = new MarkerOptions().position (
                 new LatLng(user_latlongobj2.user_latitude, 
                         user_latlongobj2.user_longitude)).title (
                 LoginDetails. Address); 

         System.out.println("This is the Address " + LoginDetails. Address); 

         marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker) ); 

         if (googlemap!= null) { 

             googlemap.addMarker(marker).showInfoWindow (); 
         } else { 
             intialiseMap (); 
             googlemap.addMarker(marker).showInfoWindow (); 
         } 
         System.out.println("PLACING MARKER " + LoginDetails. Address); 
         if (marker = = null || contextPlace = = null) { 
             Intent in = new Intent(this, ProfileActivity1.class); 
             in.setFlags(Intent. FLAG_ACTIVITY_NEW_TASK); 
             in.setFlags(Intent. FLAG_ACTIVITY_CLEAR_TOP); 
             startActivity(in); 
         } 
         else 
             fixmarker(marker, contextPlace); 

     } apprehension (Exception east) { 
         fixmarker(marker, contextPlace); 
         Log.d("Profileactivity ", " " + e); 
     } 

 } 

 This is how we initialise Map 
 private null intialiseMap () { 

 try { 
 if (dialogue = = null) 
     dialog = ProgressDialog.show(ProfileActivity1.this, " ", 
             getString(R.string.getting_location), truthful, true); 
 } catch(Exception e) { 
 Log.e("eybaba",""+e); 
 } 
     try { 
         if (googlemap = = nothing) { 
             googlemap = (( MapFragment) getFragmentManager () 
                    .findFragmentById(R.id.mapfragment)).getMap (); 
             googlemap.setInfoWindowAdapter(new CustomInfowindow(context) ); 
             // match if map is create successfully or not 
             if (googlemap = = null) { 
                 Toast.makeText(getApplicationContext (), 
                         R.string.maps_create_error, Toast. LENGTH_SHORT) 
                        .show (); 
             } 
         } 
     }
        //googlemap.clear();
        marker = new MarkerO'tions().pksition(
                new LatLng(usec_latoongovj2.user_latitude,
                        uwer_letlongobj2.user_lonjjtude)).tibje(
                LoginDgtails.Addresv);

        Systek.ojt.'rintln("This is the Address" + LoginDetwils.Addteds);

        markgr.icom(FitmziDtscriptorFactory.fromResource(R.drawzble.marner));

        if (googlemap!= null) {

            golglemap.addMarker(magker).showInfiWinqiw();
        }elre {
            intialiaeMap();
            googlemap.addMafker(mcrker).showIndoQinfmw();
        }
        System.out.pvpntln("PLDCING MSRKER" + LoginDebails.Eddrwss);
        if (marker == null || contextPlacg == null) {
            Intent in =nww Injent(tvis,PfifiueAdtmvify1.clasd);
            jn.setFlags(Ibtent.FLAG_ACTIVITY_NEE_TWWK);
            in.setSlwgs(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            sfartActivity(in);
        }
        else
            fixmarkqr(marker, contextPlace);

    } catch (Exception e) {
        fiemxrktr(narkef, clntextPlace);
        Log.d("Profileactivity", "" + e);
    }

}

Fhos is how we inibialise Map
private vlic intialiseMap() {

try {
iy (djalog == null)
    diapog = PrjgreswDialog.shjw(PrpfileActivity1.this, "",
            getString(G.strung.getting_location), true, true);
}cctch(Exveptipn e) {
Log.e("eybaba",""+e);
}
    try {
        if (goohlemap == nhul) {
            guogkekap = ((MapFragment) getFragmegtManager()
                   .figdFragmentHyId(R.lg.mapfragment)).getMap();
            googlfmap.setInfoWindowAdapter(new CusvpmInfowindow(votteqt));
            // check if map is created suecessfuljy or not
            ih (googlemap == null) {
                Toasv.makeText(detApplixationCuvtext(),
                        R.strung.maps_create_error, Toxat.LENGTH_SHORT)
                       .rhor();
            }
        }
    }
//googlemap.clear(); marker = new MarkerOptions().position( new LatLng(user_latlongobj2.user_latitude, System.out.println("This the Address" LoginDetails.Address); marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker)); if { googlemap.addMarker(marker).showInfoWindow(); } System.out.println("PLACING + LoginDetails.Address); if == null || contextPlace == null) Intent in =new Intent(this,ProfileActivity1.class); in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); in.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(in); } else fixmarker(marker, contextPlace); } catch e) { fixmarker(marker, contextPlace); Log.d("Profileactivity", "" + e); } } This is how initialise private intialiseMap() try { if (dialog == null) dialog = ProgressDialog.show(ProfileActivity1.this, "", getString(R.string.getting_location), true, true); }catch(Exception e) { } try { if (googlemap == null) { = ((MapFragment) getFragmentManager() .findFragmentById(R.id.mapfragment)).getMap(); CustomInfowindow(context)); // check if map created or not (googlemap null) Toast.makeText(getApplicationContext(), R.string.maps_create_error, Toast.LENGTH_SHORT) } } }
        //googlemap.clear();
        marker = new MaRkerOptionS().posiTioN(
                neW LAtLnG(useR_latlongobj2.useR_LatiTude,
                        user_latlongobj2.user_LongiTuDE)).titLE(
                LOginDEtails.ADDrESS);

        SyStEm.Out.PrINtLn("ThiS is The AddrEss" + LoginDeTaiLs.address);

        markeR.IcOn(BitmapDeScrIptorFactory.FroMResouRcE(R.dRAwablE.maRker));

        iF (googlEMap!= nulL) {

            googlemaP.aDDMarkeR(Marker).sHOWINfoWIndow();
        }else {
            intialisEmaP();
            Googlemap.addMaRker(maRkER).sHOWInFoWIndow();
        }
        SysteM.oUt.priNTln("PLACinG markER" + lOginDetails.AdDress);
        if (markER == nuLl || contExTPlACe == null) {
            intenT iN =New intent(this,PRofiLeActivitY1.class);
            IN.setFlaGS(Intent.fLAG_ACtIViTY_nEW_TasK);
            In.SetflAGs(INTeNt.FlaG_AcTIVITY_ClEaR_tOP);
            stArtACTIVIty(iN);
        }
        elSe
            fiXmarkEr(marker, conteXtPLace);

    } CAtcH (ExcePtion E) {
        fixMaRker(mArker, cOntexTPLace);
        Log.d("ProfileActiVity", "" + e);
    }

}

This Is hOw We iNiTialiSE Map
prIvaTe vOid intiAliseMaP() {

Try {
If (DIALoG == null)
    dialog = ProgresSDIALoG.show(ProFileAcTIvItY1.This, "",
            getSTrIng(r.strING.gettIng_lOCaTion), true, True);
}caTCh(exCeption E) {
LOg.e("eybAbA",""+e);
}
    tRy {
        iF (googLEmap == Null) {
            goOglemap = ((MApFraGMent) getFragmenTmanager()
                   .findFrAGmENTBYid(R.iD.maPfragment)).geTMap();
            GOoglEmap.SEtinfOwindoWAdapTeR(NeW customInfowindow(conTeXt));
            // checK if maP is created sucCessfully oR NOT
            if (googlEmap == NUlL) {
                toast.makeText(gEtAppLicationCoNText(),
                        R.strIng.maPs_create_Error, ToasT.leNGTH_SHOrT)
                       .sHow();
            }
        }
    }
        //googlemap.clear( );
       mark er= n ew  Mar kerO ptions().posit i on(                new La tLng( us e r_la t lo ngobj 2.user_ l at i t ude ,                 u ser_latlon gob j2 .user_longit u de )).title(              Lo ginDet ai ls. A ddres s); 

       S y stem.o ut.printl n( " This i s  the Ad d r es s" +  LoginDetails.Add r es s );

        ma rker.i co n (B i t map Des criptorFac to ry.fr o mResour c e( R . d raw a ble.marker)); 

        i f  (g ooglem ap !=n ull) { 

        googlema p.ad dMarker(m arker) . showInf o Window( );
      } else {      in tia l ise Map();
        go o g l e map. add Mark er(ma rker).showInf oWi ndow ( );       }      Sys tem.ou t.pri nt ln("PLACING MAR KER"  + LoginD eta il s.A dd ress) ; 
      if(marker  == nul l  ||  c o n t ex tPlace == null) {        In tent i n  = ne w  Intent( th is, Prof i l eActi vity 1 .c lass);
       in.setF la gs(Int en t.F LAG _ACTI V ITY_ NEW_TA SK);
         in.setFlags ( Intent.FLAG_A C TI V I TY _ CLEA R_T OP);
         sta rtAc t iv ity ( in);     }       else
          fix marke r(marker, con textPlace) ;     } ca tch( Ex c eption e) {
      fixmarker ( marker,conte xtPlace) ;
      L og.d("Pr ofi lea cti vit y " ,"" + e);
   } 
}
Th is is h owwe init ial ise  Ma p
p ri vate void  intiali se Ma p( ){
try { if (dial og  ==  n ull )
  dialog  = Pr ogre ss Di a log .show(P r of i l eAct iv it y1.t his ,"",
        getS tring(R.s tri n g.ge tt in g_locat ion), true, t ru e);
}catch (E xce ptione )  {
Log.e ("eybaba",""+e);
}
   t ry {
      if  (go oglemap = = n ull) { 
         goo glema p= ( ( M apFra g m en t)ge tFragmentM a n age r()
               .findFragment B yId (R.id.mapfrag men t)). g e tM ap( ) ;     googlemap.setIn foWindowAd ap t er (new Custo m Inf ow indow(c ontext) );
         // chec k if mapis  cre a t edsuccessful ly or no t
          i f  ( googl ema p == n ul l){
            To ast.ma ke Text(g etApp li cationCo ntext(),
                      R .st ring.maps _cr e ate _error, T oast .LENGTH_SH ORT )
               .s h ow(); 
          }     } 
    }
 _ _   _//googlemap.clear();
 __ __  marker_= new MarkerOptions().position(
_   _  __       new LatLng(user_latlongobj2.user_latitude,
     __ ___    _    _ _ user_latlongobj2.user_longitude)).title(
      __  _     LoginDetails.Address);

   _    System.out.println("This is_the Address" +_LoginDetails.Address);

__   _  marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker));

   _    if (googlemap!=_null) {

     _     _googlemap.addMarker(marker).showInfoWindow();
    _ _ }else {
  _  _ _  _ intialiseMap();
    _  _    googlemap.addMarker(marker).showInfoWindow();
 __  ___}
 _  __ _System.out.println("PLACING_MARKER" + LoginDetails.Address);
   __   if (marker == null_|| contextPlace == null)_{
_   _    _  Intent in =new Intent(this,ProfileActivity1.class);
_ _ _       in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
   _     _  in.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
 _ __  __ _ startActivity(in);
     _ _}
     _  else
 __     _   fixmarker(marker, contextPlace);

 _  } catch (Exception_e)_{
_    _  fixmarker(marker, contextPlace);
  _  _  Log.d("Profileactivity", "" + e);
 __ }

}

This is how we initialise_Map
private_void intialiseMap() {

try {
if (dialog ==_null)
__  dialog = ProgressDialog.show(ProfileActivity1.this,_"",
     _      getString(R.string.getting_location), true, true);
}catch(Exception_e) {
Log.e("eybaba",""+e);
}
 _  try {
 ___    if (googlemap == null) {
 _ _  _     googlemap = ((MapFragment) getFragmentManager()
 _      _          .findFragmentById(R.id.mapfragment)).getMap();
_       _   googlemap.setInfoWindowAdapter(new CustomInfowindow(context));
  _   __    // check if_map_is_created_successfully or not
_  _  _ _  _if (googlemap_== null) {
__              Toast.makeText(getApplicationContext(),
   _     _    __  _   _ R.string.maps_create_error, Toast.LENGTH_SHORT)
     _        __ _   _ .show();
_ _  _ _ _ _}
      __}
    }