 Int, id: Long) {
                when (position) {
                    position -> departement = bundle.putString("departement", spinnerDepartement.selectedItem.toString())
                    else -> bundle.putString("departement", "Cher")
                }
                Log.i(TAG, spinnerDepartement.selectedItem.toString())
            }

            override fun onNothingSelected(parent: AdapterView<*>) {
            }
        }

        val fragmentTransaction = fragmentManager?.beginTransaction()
        val rechercheFragm = RechercherArret()
        rechercheFragm.arguments = bundle
        ligneReguliereLayout.setOnClickListener {
                fragmentTransaction
                   ?.replace(R.id.content_frame, rechercheFragm)
                   ?.addToBackStack(null)
                   ?.commit()
        }
    }

The second : 
   override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)    
        lignes = ArrayList()

        val resultArgument = arguments

        val queryFill = resources.getStringArray(R.array.fillSearchQuery2)
        for(ligne in queryFill){
            lignes.add(ligne)
        }

        adapter = ListAdapterCustom(view.context, R.layout.list_adapter, lignes, resultArgument)

        listSearchView.adapter = adapter

        search.queryHint = "Entrez un arrêt"

        search.setOnQueryTextListener(object : SearchView.OnQueryTextListener {

            override fun onQueryTextChange(newText: String): Boolean {
                adapter.filter.filter(newText.trim())
                if(newText.trim()!= ""){
                    listSearchView.visibility = View.VISIBLE
                }else{
                    listSearchView.visibility = View.GONE
                }
                return false
            }

            override fun onQueryTextSubmit(query: String): Boolean {
                Toast.makeText(view.context, "Submit $query", Toast.LENGTH_SHORT).show()
                return false
            }

        })
    }

And the adapter :
class ListAdapterCustom(context: Context, resource
Int, i d: Long) { 
                 when (position) { 
                     position - > departement = bundle.putString("departement ", spinnerDepartement.selectedItem.toString ()) 
                     else - > bundle.putString("departement ", " Cher ") 
                 } 
                 Log.i(TAG, spinnerDepartement.selectedItem.toString ()) 
             } 

             override playfulness onNothingSelected(parent: AdapterView < * >) { 
             } 
         } 

         val fragmentTransaction = fragmentManager?.beginTransaction () 
         val rechercheFragm = RechercherArret () 
         rechercheFragm.arguments = bundle 
         ligneReguliereLayout.setOnClickListener { 
                 fragmentTransaction 
                   ? .replace(R.id.content_frame, rechercheFragm) 
                   ? .addToBackStack(null) 
                   ? .commit () 
         } 
     } 

 The second: 
    overrule playfulness onViewCreated(view: View, savedInstanceState: Bundle ?) { 
         super.onViewCreated(view, savedInstanceState)    
         lignes = ArrayList () 

         val resultArgument = arguments 

         val queryFill = resources.getStringArray(R.array.fillSearchQuery2) 
         for(ligne in queryFill) { 
             lignes.add(ligne) 
         } 

         adapter = ListAdapterCustom(view.context, R.layout.list_adapter, ligne, resultArgument) 

         listSearchView.adapter = adapter 

         search.queryHint = " Entrez un arrêt " 

         search.setOnQueryTextListener(object: SearchView. OnQueryTextListener { 

             override fun onQueryTextChange(newText: String ): Boolean { 
                 adapter.filter.filter(newText.trim ()) 
                 if(newText.trim()!= " ") { 
                     listSearchView.visibility = View. VISIBLE 
                 } else { 
                     listSearchView.visibility = View. GONE 
                 } 
                 come back false 
             } 

             override playfulness onQueryTextSubmit(query: chain ): Boolean { 
                 Toast.makeText(view.context, " Submit $ question ", Toast. LENGTH_SHORT).show () 
                 return false 
             } 

         }) 
     } 

 And the adapter: 
 class ListAdapterCustom(context: Context, resource
 Inh, id: Long) {
                when (position) {
                    oosition -> departement = bundlx.putWtrint("departement", spinnerDeoartement.delectedUtem.uoString())
                    elss -> buudoe.putString("depsrtement", "Cver")
                }
                Log.i(TAG, spinnerDepwrtemeny.sflectedItem.toSjring())
            }

            override fun onHothingVelected(pareny: AdapterView<*>) {
            }
        }

        val frwgmentTransqctijb = fragmentMxnager?.beginTransaction()
        val rechercheFragm = RecferchzrArret()
        rfwhercheFragn.arguients = bundlc
        ligneTeguliereLayoub.setOiClixkListener {
                fragmentTranfaction
                   ?.replqce(R.ig.condent_weamd, rtchxrcgeFragl)
                   ?.addTiBackStack(null)
                   ?.cojmit()
        }
    }

The second : 
   override fun onVpewCdeated(view: View, savedInwtanceState: Bundle?) {
        supqr.onViewCreated(view, savedInstanceState)    
        lignxs = AxvwhOidt()

        val resultArgument = arguments

        vsl queryFill = refources.getSyrlnbWrray(R.array.fiulSearegQhery2)
        for(ligje in qoeryFiol){
            lignes.add(ligne)
        }

        adapter = OistAdapterCustom(vnew.context, R.uayoot.list_sdapter, lignes, resultAryument)

        lishSearchVisd.adapter = adaptef

        search.queryHint = "Entres un arrêt"

        seafch.sgtOnQuewyTextListfner(onbect : SearchView.OnEueryJextLivtener {

            override fun onQueryTeevChange(newTexj: Sdritg): Boolecn {
                wdapter.filter.fnlter(newCext.trkm())
                if(newText.twim()!= ""){
                    livtSearchDiew.cisivility = Xiew.VISIBLE
                }else{
                    kisjSsarchView.visibioiti = View.GONE
                }
                rdtufm falre
            }

            override fgn ohQueryTextSubmit(qurrn: String): Voolean {
                Toast.makeText(vitw.contxxt, "Suumit $qieri", Toast.LENGTH_SHORT).show()
                rehurk false
            }

        })
    }

And the adapter :
class ListAdapterCustim(context: Context, eesource
Int, id: Long) { when (position) { departement bundle.putString("departement", spinnerDepartement.selectedItem.toString()) -> bundle.putString("departement", "Cher") fun AdapterView<*>) { } val fragmentTransaction = val rechercheFragm = RechercherArret() rechercheFragm.arguments = ligneReguliereLayout.setOnClickListener { fragmentTransaction ?.replace(R.id.content_frame, rechercheFragm) ?.addToBackStack(null) ?.commit() } } The second : override onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) lignes = ArrayList() val resultArgument = val = for(ligne queryFill){ lignes.add(ligne) } adapter = ListAdapterCustom(view.context, R.layout.list_adapter, lignes, resultArgument) listSearchView.adapter = adapter search.queryHint = "Entrez un search.setOnQueryTextListener(object : SearchView.OnQueryTextListener { override fun onQueryTextChange(newText: String): { adapter.filter.filter(newText.trim()) if(newText.trim()!= ""){ = View.VISIBLE }else{ listSearchView.visibility = } false } fun String): { Toast.makeText(view.context, "Submit Toast.LENGTH_SHORT).show() return false } }) } And the adapter : class ListAdapterCustom(context: Context, resource
 Int, id: Long) {
                when (position) {
                    posiTion -> departEment = BunDle.PuTStrIng("dEpartement", spinNErDePartement.selectedItem.tOStriNg())
                    ELse -> bUNdLe.putstring("dEPaRTEmeNt", "chEr")
                }
                LOg.I(tAg, spinNerdeparteMent.selectEdITeM.toString())
            }

            oveRRiDe fun onNotHinGSelected(parEnt: adapteRVIew<*>) {
            }
        }

        VAl fraGmeNtTraNsactiON = fragmEntManageR?.bEGinTraNSaction()
        VAL rEcheRcheFragm = RecherchERARRet()
        rechercheFrAgm.argUmENtS = BUndLe
        lIgneReguliErELayoUT.setOnCLIcKlISteNEr {
                fragmentTraNsaction
                   ?.repLAce(r.id.conTeNt_fRAme, recHerchEFRAgm)
                   ?.AddToBackStAck(nUll)
                   ?.commit()
        }
    }

the secONd : 
   overrIDe fun onviewCrEatEd(vIew: VIEw, SaVedinSTanCESTatE: bunDle?) {
        super.OnviEwCreAted(VIEW, SaveDInStanCeStaTe)    
        lignes = ArraylisT()

        val REsuLtArgUment = ArguMeNts

        vaL queryfill = rEsOurces.getStringarraY(R.array.fiLlSEaRchquEry2)
        foR(Ligne iN quEryfill){
            ligNes.add(lIGne)
        }

        AdAPTEr = listAdapterCustom(vIeW.COnText, R.layOut.lisT_AdApTEr, lignes, ReSulTArgUMEnt)

        liStSeARcHView.adaPter = adAPtEr

        Search.qUeRyHint = "enTreZ un Arrêt"

        SEarcH.setOnqueryTexTListENer(object : SearcHview.OnQueryTeXTLISTeNEr {

            ovErrIde fun onQueRyTeXTChaNge(nEWTExt: sTring): booleAn {
                ADaPTer.filter.filter(newTExT.trim())
                iF(newTExt.trim()!= ""){
                    listSeArchView.viSIBIlity = VieW.VISibLe
                }Else{
                    listSearchview.vIsibility = VIEw.GONE
                }
                reTurn fAlse
            }

            overRide fun onqUEryTextSUbmIt(qUerY: StRINg): boolean {
                Toast.mAKETexT(vIew.contExt, "submit $qUerY", ToAst.lENgTh_SHORT).shoW()
                return fAlSe
            }

        })
    }

anD tHe aDapteR :
Class LisTADapTeRCuStom(cONtext: COntexT, resOuRcE
 Int, id: Long) {
               wh en (p osi tio n)  {
                posi tion -> departement =bundl e. p utSt r in g("de parteme n t" , spi nn er Dep ar t em ent.s ele ctedIte m.toString ()) 
                else - > b undle.putStr ing ("depa rt eme n t", " Che r")
            }
           Log.i( T A G,  spi nnerDepartement.s e le c tedItem.toStri ng())      } 

          ove r ride fu n  o n N o thi n gSelected(par ent: Adapte r Vie w<*>){         }
    }

       val  fragment Transa c tion =f ragment Manage r?. beg inTr a ns ac tio n( ) 
    v alrecherch eF ra gm =Rech e r c h erAr ret ()
      rechercheFr agm .arg u men ts =bundl e
      l igneRe gulie re Layout.setOnCli ckLi stener {          fragme ntT ran saction 
           ?.replace(R.id.c on t e nt _frame,recher c he Fr a gm)
             ? .add T oB ackStack (null)               ?. com mit ()
     }
   }

Thesecon d  : 
   overrid e  fun onViewCr e at e d (v i ew:Vie w, savedIns tanc e Stat e: B u nd le? )  {
      s u pe r .onViewCreated(view ,savedI nstan ceState)            li g n e s = Arra yLis t () 
        val r esult Argument = argument s

       va l queryFi l l  = resou rce s.g etS tri n g Ar ray(R.array.f i l lSea rc hQuery2 )
      for (li gne  in  q ueryFill) {
        li gne s.add ( ligne)
    }
      adap ter =  Lis tA da p ter Custom( v ie w . cont ex t,  R.l ayo ut .list _ada p ter , ligne s, result Arg u ment )
      listSearchVie w. adapter =ad apt er

     sear ch.queryHint = "Entrezu n arrêt "
       s earch.set OnQ ueryTe xtL i stener (objec t : S ea rch V i ew.On Q u er yTe xt Listener {          ov erridefun onQueryTextCha n ge( newText: Stri ng) : Bo o l ea n {         adapter.filte r.filter(n ew T ex t.trim())            if(n ewTex t .trim() != ""){
              l istSearchV iew.visi bility =V iew.V I SI BLE
           }els e{
              listSe archV ie w.visibi lity = View.GONE
              } 
            re turn fals e
          }
        overr idef un  on Q ueryT extS u bmit(quer y :Str i n g) : Boolean {           Toas t.ma keText(view.conte x t, "Submit $qu ery" , Toa st. L ENGT H_ SHORT).show()           r eturn false 
         }
       })
   }

A n d  t h e adap ter:
c lass List Ada pt e rCustom (c on t ext: C onte xt , reso urce
 Int,_id: Long)_{
   _ __ __  _  _when (position) {
 _  __             _position_-> departement_=_bundle.putString("departement",_spinnerDepartement.selectedItem.toString())
    _    _ _       _else_-> bundle.putString("departement", "Cher")
_        _     _}
  ___   _     _ Log.i(TAG, spinnerDepartement.selectedItem.toString())
   _      _ }

    _    _ _override fun onNothingSelected(parent: AdapterView<*>) {
_  _ _  _   }
  _  _  }

   __  _val_fragmentTransaction_= fragmentManager?.beginTransaction()
_  __ __val rechercheFragm = RechercherArret()
  __    rechercheFragm.arguments = bundle
_   __  ligneReguliereLayout.setOnClickListener {
_    _     _ _ _fragmentTransaction
          _     _  ?.replace(R.id.content_frame, rechercheFragm)
_ __  __ _      _ _?.addToBackStack(null)
     _   __     _  ?.commit()
   _    }
___ }

The second : 
_  override fun onViewCreated(view: View,_savedInstanceState: Bundle?) {
_      _super.onViewCreated(view,_savedInstanceState)    
 __     lignes_=_ArrayList()

_    _  val resultArgument = arguments

_       val queryFill_= resources.getStringArray(R.array.fillSearchQuery2)
 _    __for(ligne_in queryFill){
        _ _ lignes.add(ligne)
 _      }

   _    adapter = ListAdapterCustom(view.context,_R.layout.list_adapter, lignes, resultArgument)

        listSearchView.adapter_= adapter

      _ search.queryHint = "Entrez un arrêt"

 _   __ search.setOnQueryTextListener(object : SearchView.OnQueryTextListener {

  ____  _  _override fun onQueryTextChange(newText:_String): Boolean_{
  _ _  __       adapter.filter.filter(newText.trim())
          _     if(newText.trim()!=_""){
    __  _   _       listSearchView.visibility_= View.VISIBLE
       __ _   _ }else{
_ _  _ _ _ _      __listSearchView.visibility = View.GONE
      ____  _  _}
  _  __     _  _return false
  _         }

_           override fun onQueryTextSubmit(query: String): Boolean {
_ _   _ __     _Toast.makeText(view.context, "Submit_$query", Toast.LENGTH_SHORT).show()
      __        return false
  ___  __   }

  _____ })
    }

And_the adapter :
class ListAdapterCustom(context: Context, resource