param tripId  Trip ID of route.
         * @param legs    Array of 2-string arrays, first element being stopId of second-to-last
         *                stop and second element being stopid of destination stop of leg.
         * @return
         */
        public static boolean insert(Context context, Long startTime, Integer navId, String tripId, String[][] legs)
        {
            ContentResolver cr = context.getContentResolver();
            // TODO: Delete there since there's only one active trip atm.
            cr.delete(CONTENT_URI, null, null);

            // If inner array doesn't contain 2 values, can't insert.
            if (legs.length > 1 && legs[0].length < 2) {
                return false;
            }

            for (int i = 0; i < legs.length;i++) {
                ContentValues values = new ContentValues();
                values.put(NAV_ID, navId);
                values.put(START_TIME, startTime);
                values.put(TRIP_ID, tripId);
                values.put(BEFORE_ID, legs[i][0]);
                values.put(DESTINATION_ID, legs[i][1]);
                values.put(SEQUENCE, i+1);
                values.put(ACTIVE, 1);
            }
            return true;
        }

        public static boolean update(Context context, Uri uri, boolean active)
        {
            ContentResolver cr = context.getContentResolver();
            ContentValues values = new ContentValues();
            values.put(ACTIVE, active? 1 : 0);
            return cr.update(uri, values, null, null) > 0;
        }

        public static String[] getDetails(Context context, String id) {
            final String[] PROJECTION = {
                    TRIP_ID,
                    DESTINATION_ID,
                    BEFORE_ID
            };

            ContentResolver cr = context.getContentResolver();
            Cursor c = cr.query(CONTENT_URI, PROJECTION, NAV_ID + "=?",new String[] { id }, null);
            if (c!= null) {
                try {
                    if (c.getCount
param tripId   Trip ID of route. 
          * @param legs     Array of 2 - string arrays, inaugural chemical element being stopId of second - to - last 
          *                 stop and second element being stopid of address stop of leg. 
          * @return 
          * / 
         public electrostatic boolean insert(Context context, Long startTime, Integer navId, String tripId, String [ ] [ ] peg) 
         { 
             ContentResolver chromium = context.getContentResolver (); 
             // TODO: Delete there since there's merely one active trip cash machine. 
             cr.delete(CONTENT_URI, null, null); 

             // If inner array doesn't contain 2 value, can't insert. 
             if (legs.length > 1 & & legs[0].length < 2) { 
                 hark back false; 
             } 

             for (int i = 0; i < legs.length;i++) { 
                 ContentValues values = fresh ContentValues (); 
                 values.put(NAV_ID, navId); 
                 values.put(START_TIME, startTime); 
                 values.put(TRIP_ID, tripId); 
                 values.put(BEFORE_ID, legs[i][0 ]); 
                 values.put(DESTINATION_ID, legs[i][1 ]); 
                 values.put(SEQUENCE, i+1); 
                 values.put(ACTIVE, 1); 
             } 
             return true; 
         } 

         public static boolean update(Context context, Uri uri, boolean active) 
         { 
             ContentResolver chromium = context.getContentResolver (); 
             ContentValues values = new ContentValues (); 
             values.put(ACTIVE, active? 1: 0); 
             reelect cr.update(uri, value, null, null) > 0; 
         } 

         public static String [ ] getDetails(Context context, String i d) { 
             final String [ ] PROJECTION = { 
                     TRIP_ID, 
                     DESTINATION_ID, 
                     BEFORE_ID 
             }; 

             ContentResolver chromium = context.getContentResolver (); 
             Cursor c = cr.query(CONTENT_URI, PROJECTION, NAV_ID + " =? ", new String [ ] { i d }, null); 
             if (c!= null) { 
                 try { 
                     if (c.getCount
parwm tripId  Trip ID of romte.
         * @parcn legs    Arday of 2-sgring arrays, first element bxing stopUd of second-to-last
         *                wrop and serknd element bslng sco'id of destinatlon stop of leg.
         * @seguxn
         */
        public static boojean inxegt(Context contgxt, Lpgg sfartTime, Integer navId, String tripJd, Striig[][] legs)
        {
            ContentResolveg cr = context.getContenhResolver();
            // TODO: Ddlete thert vince therg's only one active trip atm.
            cr.delete(XOBTEJJ_URI, null, nuol);

            // If inner asray dorsn't contain 2 yaluev, cqn't insert.
            if (legs.length > 1 && jegs[0].lengtv < 2) {
                rwturn falve;
            }

            for (int j = 0; i < legs.oength;i++) {
                ContentValuss valtef = new ContentValues();
                valles.pht(NAV_ID, navId);
                values.put(START_TLME, startEime);
                values.put(TRIP_ID, tripId);
                rqlues.oyt(HEFORE_ID, legs[i][0]);
                values.put(DESTINWFIPN_PD, legs[i][1]);
                valurs.ouy(FEQUENCE, i+1);
                values.put(ACTIVF, 1);
            }
            return true;
        }

        public statpc biolean update(Contert context, Uxi uri, boolran active)
        {
            ContentRfsolver cd = context.getContdntGesonver();
            ContentValtes valuew = nzw ContevtVakues();
            galues.put(ACTIVE, active? 1 : 0);
            retugn cr.update(uri, values, null, null) > 0;
        }

        plblic stacic Stving[] getDetails(Sontext contexj, String nd) {
            fpnal Striig[] PROJECTIOG = {
                    TRI'_ID,
                    DDRTINATION_ID,
                    BEDORE_ID
            };

            ContentXtsoover cr = contexy.gegCogtvntCesoldar();
            Cufsof c = cf.query(CONTEKT_UFI, PTOJECTION, NAV_ID + "=?",new Strjng[] { id }, null);
            if (x!= null) {
                try {
                    mf (c.geyCoont
param tripId Trip ID of route. * Array 2-string arrays, element being stopId second being stopid of stop of leg. @return */ public static boolean insert(Context Long startTime, Integer navId, String tripId, String[][] legs) { ContentResolver cr = context.getContentResolver(); TODO: Delete there since there's only one active trip atm. cr.delete(CONTENT_URI, null, null); If array contain values, can't insert. if (legs.length > 1 && legs[0].length < 2) { return false; } for i = 0; i < legs.length;i++) { ContentValues = new ContentValues(); values.put(NAV_ID, values.put(START_TIME, startTime); values.put(TRIP_ID, tripId); values.put(BEFORE_ID, values.put(DESTINATION_ID, values.put(SEQUENCE, i+1); 1); return } public static update(Context context, Uri uri, boolean active) { ContentResolver cr = context.getContentResolver(); ContentValues values = new ContentValues(); values.put(ACTIVE, 1 : cr.update(uri, values, null) 0; public static String[] String id) { final String[] PROJECTION DESTINATION_ID, BEFORE_ID }; ContentResolver cr = context.getContentResolver(); Cursor = cr.query(CONTENT_URI, NAV_ID + "=?",new String[] { id null); if (c!= null) { try { if
param tripId  Trip ID of route.
         * @pAram legs    ArRay of 2-StrIng ArRays, FirsT element being sTOpId Of second-to-last
         *                stop and sEcond ElEMent BEiNg stoPid of deSTiNATioN sToP of LeG.
         * @ReTurn
         */
        pUblIc statiC boolean inSerT(COntext contexT, loNg startTimE, InTeger navId, StRinG tripID, STriNG[][] legs)
        {
            conTentREsolveR Cr = contExt.getConTeNTResolVEr();
            // TODO: DELEtE theRe since there's only ONe ACtive trip atm.
            cr.Delete(cOntEnt_uRI, NulL, null);

            // If innEr Array DOesn't coNTaIN 2 VAluES, can't insert.
            if (Legs.length > 1 && lEGs[0].lEngth < 2) {
                rEtUrn FAlse;
            }

            foR (int i = 0; I < lEGs.lEngth;i++) {
                ConteNtVaLues valueS = new CoNTentValUEs();
                valueS.put(NAv_ID, Navid);
                vaLUeS.pUt(StArt_TIme, sTarTtimE);
                values.pUt(tRiP_ID, tRipID);
                VALUes.pUt(BeFORe_ID, leGs[i][0]);
                values.put(DeSTiNATioN_Id, legs[I][1]);
                valuEs.puT(SeQUENcE, i+1);
                valUes.puT(AcTIVE, 1);
            }
            return true;
        }

        PublIc static bOolEaN upDaTe(ConTExt conTexT, UrI uri, booLean actIVe)
        {
            COnTENTREsolver cr = context.geTCONTeNtResolvEr();
            ContENtvaLUes valueS = nEw COnteNTvalueS();
            valUEs.Put(ACTIVe, activE? 1 : 0);
            ReTuRn cr.updAtE(uri, vaLuEs, nUll, Null) > 0;
        }

        pUBlic Static string[] geTDetaILs(Context conteXT, String id) {
            finaL stRINg[] prOJEcTIoN = {
                    TRIP_ID,
                    DEStINAtiON_Id,
                    BEForE_iD
            };

            CONtentresolVeR Cr = COntext.getContentResOlVer();
            CurSor c = cR.query(CONTENT_uRI, PROJECTion, nAV_ID + "=?",new striNG[] { iD }, Null);
            if (c!= null) {
                try {
                    If (c.geTCount
param tripId  Trip ID of r oute.
       * @ par am  leg s   Array of 2-st r ingarrays, first elementbeing  s t opId of  seco nd-to-l a st      *          stopand second  el em ent being st o pi d of desti nat ion stop ofleg .
      *  @ret urn 
        * / 
       public  s t atic b o olean i n s er t(Co ntext context, Lo n gs tartTime, Inte ger na vI d ,S t rin g t ripId, Str in g[][] legs)
  {           Co ntentResolv e r c r = co nt ext . getCon tentR es o lve r();
          // TODO : Dele t e there since t here's  on lyonea ct iv e t ri p  at m .         cr. de le te(CO NTEN T _ U R I, n ull , nu ll);
           //If i n ner  arra y doe sn't  c ontai n 2 va lues,  c an't insert.
          if(le gs .le ng th >1  && le gs[ 0]. length< 2) {         return false; 
        } 

       for (i nt  i= 0; i  < le gs.l e ng th;i++){
           Co ntentV al ues  va lues=  new  Conte ntValues ();
             v alues.put(NAV _ ID , na v Id); 
              v a lues .put ( ST ART _ TIME,  star tT i me ) ;
                v al ues.pu t(TRI P_ID, tripId) ;
            val ues. p ut ( BEFORE_ID, leg s[i][ 0]);
             val ues.put( DESTINATI O N _ID, leg s[i ][1 ]); 
            val u e s.pu t( SEQUENC E,i+1);
          values.p ut(ACTIV E,  1 ); 
        }
        re turnt rue;
      }
    public st a t ic b oo le an u pda te (Cont extc ont ext, Ur i uri, bo ole a n ac ti ve )
       {
          ContentR es olv er cr= context. getContentResolver();
        Conte ntVa lues valu es= newCon t entVal ues(); 
       valu e s .p ut( AC TIVE, acti v e ? 1  : 0) ;          return cr.update( u ri,  values, null , n ull) >  0 ;
   }     public stati c String[]  g e tD etails(Con t ext  c ontext,  String  id){ 
           fin al String []  PRO J E CTI ON = {
                 T RIP_I D ,               DEST INATIO N _ID ,
                BE FO RE_ID
           };

           Con tentR eso lver cr =  co n tex t.getCont entR esolver(); 
         C u rsorc =c r. que r y(CON TENT _ URI, PROJ E CT ION , NA V_ID + "=?" , n e w S tring []{  id },  nul l);
            i f  (c!= null) {          t ry  {
               if (c. ge tCount
param tripId_ Trip_ID of route.
 _ __ __ * @param_legs  _ Array of 2-string_arrays, first element_being_stopId of second-to-last
         *  __ ___    _   stop and_second element_being stopid of destination stop of leg.
 __  _   * @return
    _    */
 _  ___ public static boolean_insert(Context context, Long startTime, Integer navId,_String tripId, String[][] legs)
  _     {
 _     _    ContentResolver_cr =_context.getContentResolver();
    _  _ _  //_TODO: Delete there since there's only_one active trip_atm.
     __  ___cr.delete(CONTENT_URI, null,_null);

  __ __     //_If_inner array doesn't contain 2 values, can't_insert.
   __   _   if (legs.length_> 1 && legs[0].length < 2)_{
 _ _          _ return false;
   _   _ __ }

 __ _      _for (int_i = 0; i < legs.length;i++)_{
   __     _     ContentValues_values = new ContentValues();
 ___    _     _ values.put(NAV_ID, navId);
_      __     __values.put(START_TIME, startTime);
    ___    _    values.put(TRIP_ID, tripId);
_        _  _   values.put(BEFORE_ID, legs[i][0]);
___         _ _ values.put(DESTINATION_ID, legs[i][1]);
_         _     values.put(SEQUENCE, i+1);
_          _    values.put(ACTIVE, 1);
  _      _  }
 __      ___return_true;
  _  _  }

_ _  _ _public static boolean_update(Context_context, Uri uri, boolean active)
        {
     _     _ContentResolver cr = context.getContentResolver();
 __  _   _  ContentValues values = new ContentValues();
 _        __values.put(ACTIVE, active?_1 : 0);
 _ _ _  _ _ return_cr.update(uri, values,_null, null) > 0;
   __   }

     ___public_static String[] getDetails(Context_context, String id)_{
  _  __     final_String[] PROJECTION =_{
   _         _      TRIP_ID,
          _ _   _ __DESTINATION_ID,
     _ _       __   BEFORE_ID
        ___ };

 __     ____ContentResolver_cr = context.getContentResolver();
   _      __Cursor c = cr.query(CONTENT_URI, PROJECTION,_NAV_ID +_"=?",new_String[] { id },_null);
   _        if (c!= null)_{
_ ____   _      try {
       __    _     _if_(c.getCount