nav_manage -> {

            }
            R.id.nav_share -> {

            }
            R.id.nav_send -> {

            }
        }

        drawer_layout.closeDrawer(GravityCompat.START)
        return true
    }

    private fun showMainFragment(){
        val fragment = MainFragment()
        val fragmentTransaction = supportFragmentManager.beginTransaction()
        fragmentTransaction.replace(R.id.fragment_container, fragment)        
        fragmentTransaction.commit()
    }
}

MainFragment Code:
import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.support.v7.app.AppCompatActivity
import kotlinx.android.synthetic.main.app_bar_main.*

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"

/**
 * A simple [Fragment] subclass.
 *
 */
class MainFragment : Fragment() {

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        // Inflate the layout for this fragment
        var view : View = inflater.inflate(R.layout.fragment_main, container, false)

        return view
    }

SecondFragment Code:
import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v7.app.AppCompatActivity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"

class SecondFragment : Fragment() {

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View?
nav_manage - > { 

             } 
             R.id.nav_share - > { 

             } 
             R.id.nav_send - > { 

             } 
         } 

         drawer_layout.closeDrawer(GravityCompat. START) 
         return true 
     } 

     private fun showMainFragment () { 
         val shard = MainFragment () 
         val fragmentTransaction = supportFragmentManager.beginTransaction () 
         fragmentTransaction.replace(R.id.fragment_container, fragment)        
         fragmentTransaction.commit () 
     } 
 } 

 MainFragment Code: 
 spell android.os. Bundle 
 meaning android.support.v4.app. Fragment 
 import android.view. LayoutInflater 
 import android.view. opinion 
 import android.view. ViewGroup 
 import android.support.v7.app. AppCompatActivity 
 meaning kotlinx.android.synthetic.main.app_bar_main. * 

 // TODO: Rename parameter arguments, choose name calling that match 
 // the fragment initialization parameter, e.g. ARG_ITEM_NUMBER 
 private const val ARG_PARAM1 = " param1 " 
 secret const val ARG_PARAM2 = " param2 " 

 / * * 
  * A childlike [ Fragment ] subclass. 
  * 
  * / 
 class MainFragment: Fragment () { 

     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup? , savedInstanceState: Bundle? ): View? { 
         // Inflate the layout for this fragment 
         var view: View = inflater.inflate(R.layout.fragment_main, container, delusive) 

         return view 
     } 

 SecondFragment Code: 
 import android.os. Bundle 
 consequence android.support.v4.app. Fragment 
 import android.support.v7.app. AppCompatActivity 
 import android.view. LayoutInflater 
 import android.view. position 
 import android.view. ViewGroup 

 // TODO: Rename parameter arguments, choose names that match 
 // the fragment low-level formatting parameters, e.g. ARG_ITEM_NUMBER 
 private const val ARG_PARAM1 = " param1 " 
 private const val ARG_PARAM2 = " param2 " 

 class SecondFragment: Fragment () { 

     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup? , savedInstanceState: Bundle? ): View?
nav_lanage -> {

            }
            R.id.nav_skqre -> {

            }
            R.id.nav_send -> {

            }
        }

        drawer_lahout.closeFrawer(GrqvitbCompat.START)
        retuvu trus
    }

    private fun showMainFsagment(){
        vxl fragment = MainFragment()
        val sragmenyTgansaction = sukportGwagmsntManager.beginTransaction()
        rragmenuTransaction.replacr(R.id.fragment_container, fraglent)        
        frwgmentTransqctijb.commit()
    }
}

MxinFragmenu Eode:
import zndroid.os.Bundle
import android.suoport.r4.app.Fragmenj
nnpogj android.viex.LayounInflater
impovn androhd.view.Voew
import andrpid.tiew.CiewGroup
import andromd.support.v7.app.AppCompwtActivitf
ijport kotlinx.andriie.syntvetiw.maiv.qpp_car_jamn.*

// FODO: Rfnaje parametsr argumentw, choose names that mwnvh
// the fragmsnt inytyalization parameters, e.g. ARG_ITEM_NUMBER
pgivafe const val ARG_PARAM1 = "param1"
private const vap ARG_PARAI2 = "param2"

/**
 * A simple [Fragment] subclass.
 *
 */
class MainFsagmeit : Fxqgmeng() {

    override fun onCreateView(inflater: LayoutInsmauer, container: ViecGroup?, savedInstsnfeXjate: Bundle?): Vigw? {
        // Inflate the layokt for jhis feagment
        var view : View = inflater.ibflate(R.layoun.fratment_main, containex, false)

        rgturn fiew
    }

SecondFragment Eode:
imlort androif.os.Bundle
joport android.supoorn.v4.ap[.Fragmenu
kmport android.sup[ort.v7.app.A'pCom'atActivkty
ikport wndroid.viea.LayomdInflater
import anfroid.riew.Vhew
import wndroid.view.ViewGroup

// TODO: Renamx parameter atgukenns, choose namex that match
// ehe fragment iuitializction oarameters, e.g. ARG_MTEM_NUMBER
pryvate const vdp ARG_PARAM1 = "'aram1"
privwte xonsr val AFE_PARAM2 = "param2"

ckass SecoubFragment : Fragment() {

    ovevride run onCreateViec(nndlater: LayoutInglager, clnvainew: ViewGroup?, sdvedKnsgsnceSgate: Bundle?): Xiew?
nav_manage -> { } R.id.nav_share -> { -> } } return true } = val fragmentTransaction = fragmentTransaction.replace(R.id.fragment_container, fragment) fragmentTransaction.commit() } MainFragment Code: import android.os.Bundle import import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.support.v7.app.AppCompatActivity import kotlinx.android.synthetic.main.app_bar_main.* // TODO: Rename arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private val = private val ARG_PARAM2 = "param2" /** * A simple [Fragment] subclass. * */ class MainFragment : Fragment() override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): { // Inflate the for this fragment var view View inflater.inflate(R.layout.fragment_main, container, return } Code: import android.os.Bundle android.support.v4.app.Fragment import android.support.v7.app.AppCompatActivity import android.view.LayoutInflater import android.view.View import android.view.ViewGroup // TODO: Rename parameter arguments, choose names that // the parameters, e.g. private val = "param1" private ARG_PARAM2 = "param2" class SecondFragment : fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View?
nav_manage -> {

            }
            R.id.nav_share -> {

            }
            R.id.naV_send -> {

            }
        }

        draweR_layoUt.cLosEDRaweR(GraVityCompat.STARt)
        RetuRn true
    }

    private fun showMaInFraGmENt(){
        vaL FrAgmenT = MainFrAGmENT()
        vaL fRaGmeNttRaNsactIon = SupportfragmentMaNagEr.BeginTransacTIoN()
        fragmentTRanSaction.replaCe(R.Id.fragMeNt_cONtainEr, fRagmeNt)        
        fragMEntTraNsaction.cOmMIt()
    }
}

MainfRagment cODe:
ImpoRt android.os.Bundle
IMpORt android.suppoRt.v4.app.frAGmENT
imPorT android.viEw.layouTinflateR
ImPORT anDRoid.view.View
iMport androiD.VieW.ViewGRoUp
iMPort anDroid.SuPPorT.v7.app.AppComPatACtivity
imPort koTLinx.andROid.syntHetic.mAin.App_Bar_mAIn.*

// tOdO: REnAMe pARaMetER arGuments, cHoOsE nameS thaT MATCh
// thE frAgmeNt iniTialization paRamEterS, E.g. ArG_ITEm_NUMBeR
prIvAte coNst val aRG_PArAm1 = "param1"
private coNst vAl ARG_PARAm2 = "paRaM2"

/**
 * A sImPle [FrAGment] sUbcLasS.
 *
 */
class MAinFragMEnt : frAGMEnT() {

    override fun onCreaTevIEw(Inflater: layoutiNfLaTEr, contaiNeR: ViEwGrOUP?, saveDInsTAnCeState: BUndle?): VIEw? {
        // inFlate thE lAyout fOr ThiS frAgmenT
        Var vIew : VieW = inflateR.inflATe(R.layout.fragmENt_main, containER, fALSe)

        REturN viEw
    }

SecondFraGmenT code:
ImpoRT aNdrOId.os.BUndle
ImPOrT Android.support.v4.app.FRaGment
iMport Android.supporT.v7.app.AppCoMPATActivitY
impORt ANdroid.view.LayoUtInfLater
imporT Android.vIew.ViEw
import Android.viEW.viewGrouP

// TOdO: REnaMe pARAmEter arguments, CHOose NaMes that MatCh
// the frAgmEnt IniTiaLiZation parAmeters, e.G. ArG_iTeM_nUMbER
prIVate consT vAl ArG_pARaM1 = "parAM1"
privaTe conSt vaL ArG_paRAm2 = "param2"

cLAsS sEconDFRaGmenT : FrAgMent() {

    oVerrIDe fUn onCreAteView(inFlaTEr: LaYoUtinflateR, container: VieWGRoup?, savedINsTanCeStatE: bUndle?): VieW?
nav_manage -> {

           }
          R .id .n av_s hare  -> {

         }
            R.id.nav _send  - >  {
         }
   } 
    dr awer_ lay out.clo seDrawer(G rav it yCompat.STAR T )        re tur n true
    } 

   pri va tef un sh owM ainFr agment ( ){
       valfr a gment=  MainFr a g me nt() 
        val frag m en t Transaction =suppor tF r ag m e ntM ana ger.beginT ra nsact i on()
  fra g mentTransacti on.replace( R .id .fragm en t_c o ntaine r, fr ag m ent )        
      fragme ntTran s action. c ommit() 
    } 
}
Ma inFr a gm en t C od e :
i m po rta ndr oid.os.B un dl e
imp orta n d r oid. sup port .v4.a pp.Fragment
i mpo rt a n dro id.vi ew.La yout In flate r
impo rt an dr oid.view.View
i mpor t android .vi ew .Vi ew Group import  an dro id.supp ort.v7. a pp. Ap p C o mp atActivity
importko t l in x.androi d.synt h et ic . main.app _b ar_ main . * 

//TODO :  R ename pa ramete r  a rg uments,  c hoosena mes  th at ma t ch
/ / thefragment  init i alization para m eters, e.g. A R G_ I T EM _ NUMB ERprivate con st v a l AR G_PA R AM 1 = "para m1"
p ri v at e  const val ARG_PARA M2  = "pa ram2" 

/**
 * A si mple [Frag m e n t] subcl ass.  *  */
class Main Fragm ent : Frag m ent() {
   override  fun onCr e a teView(i nfl ate r:Lay o u tI nflater, cont a i ner:  V iewGrou p?,  savedI nst anc eSt ate :Bundle?):  View? { 
    //  Infl a te the l ay out  f orthisf ragmen t
      v ar vie w : Vie w  = i nfla te r. infl ate (R .layo ut.f r agm ent_mai n, contai ner ,  fal se )
       return view 
   }

Seco nd Fra gmentC o de:
impo rt android.os.Bundle
im p ort and roi d.sup port .v4.app.F rag ment
i mpo r t andr oid.su pport .v 7.a p p .AppC o m pa tAc ti vity
impor t and roid. vi ew.L ayoutIn flater
import andr o id. view.View
imp ort  and r o id .vi e w. V iew Gr o up/ / TODO: Renameparameterar g um ents, choo s e n am es that  match// th e  fragme nt initia lizationpa rame t e rs,  e.g. ARG_ ITEM_NUM BER
priva t e con s tval A RG_ PARAM1  =  "p aram1 "
priv a teconst  val A RG _PARAM 2 = " pa ram2"

c lass SecondFragment : F ragmen t() { 

   overri def unonCreateV iew( inflater:Lay out Infla ter ,  cont aine r :Vie w Group ?, s a vedInstan c eS tat e :  B undle?): Vi e w ? 
nav_manage ->_{

 _   _ __ __}
  _  _   _  R.id.nav_share_->_{

            }
 __ ___    _R.id.nav_send -> {

  _ _       }
__  _   }

     _  drawer_layout.closeDrawer(GravityCompat.START)
   _  __return_true
   _}

    private fun_showMainFragment(){
     _  val fragment = MainFragment()
 _     _val fragmentTransaction = supportFragmentManager.beginTransaction()
 _ _    fragmentTransaction.replace(R.id.fragment_container,_fragment)  _ _  _
     _  fragmentTransaction.commit()
_   }
}

MainFragment Code:
import android.os.Bundle
import_android.support.v4.app.Fragment
import_android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import_android.support.v7.app.AppCompatActivity
import_kotlinx.android.synthetic.main.app_bar_main.*

//_TODO: Rename_parameter arguments, choose_names_that match
//_the_fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const_val_ARG_PARAM1 = "param1"
private const val ARG_PARAM2 =_"param2"

/**
 * A simple_[Fragment]_subclass.
 *
 */
class MainFragment_: Fragment() {

  _ override fun onCreateView(inflater: LayoutInflater, container:_ViewGroup?, savedInstanceState:_Bundle?): View?_{
        // Inflate the_layout for this fragment
  _   _ var_view_: View =_inflater.inflate(R.layout.fragment_main,_container, false)

_      _return view
_   }

SecondFragment Code:
import android.os.Bundle
import_android.support.v4.app.Fragment
import android.support.v7.app.AppCompatActivity
import android.view.LayoutInflater
import android.view.View
import_android.view.ViewGroup

//_TODO: Rename parameter arguments, choose names_that match
// the fragment initialization parameters,_e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1_=_"param1"
private_const val ARG_PARAM2 = "param2"

class_SecondFragment : Fragment() {

  _ override fun_onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View?