package Ġcom . google . android . gms . example . ap ide mo Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġcom . google . android . gms . ads . ad manager . Ad Manager Ad Request Ċ import Ġkotlinx . android . synt hetic . main . fragment _ gam _ category _ ex clusion . ex clusions _ av _ cat sex clude d Ċ import Ġkotlinx . android . synt hetic . main . fragment _ gam _ category _ ex clusion . ex clusions _ av _ dog sex clude d Ċ import Ġkotlinx . android . synt hetic . main . fragment _ gam _ category _ ex clusion . ex clusions _ av _ none Ċ Ċ /** Ċ Ġ* ĠThe Ġ[ Ad Manager Category Ex clusion Fragment ] Ġclass Ġdemonstrates Ġhow Ġto Ġuse Ġcategory Ġex clusions Ġwith Ċ Ġ* ĠAd ĠManager Ġrequests Ċ Ġ*/ Ċ class ĠAd Manager Category Ex clusion Fragment Ġ: ĠFragment () Ġ{ ĊĊĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠ Ġ): ĠView ? Ġ{ ĊĠĠĠ Ġreturn Ġinflater . inflate ( R . layout . fragment _ gam _ category _ ex clusion , Ġcontainer , Ġfalse ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġon Activity Created ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠ Ġsuper . on Activity Created ( savedInstanceState ) ĊĊĠĠĠ Ġval Ġno Ex clusions Request Ġ= ĠAd Manager Ad Request . Builder (). build () ĊĠĠĠ Ġval Ġdo gs Excluded Request Ġ= ĠAd Manager Ad Request . Builder () ĊĠĠĠĠĠ Ġ. add Category Ex clusion ( getString ( R . string . category ex clusion _ dog sc ategory name )) ĊĠĠĠĠĠ Ġ. build () ĊĠĠĠ Ġval Ġcats Excluded Request Ġ= ĠAd Manager Ad Request . Builder () ĊĠĠĠĠĠ Ġ. add Category Ex clusion ( getString ( R . string . category ex clusion _ cat sc ategory name )) ĊĠĠĠĠĠ Ġ. build () ĊĊĠĠĠ Ġex clusions _ av _ none . load Ad ( no Ex clusions Request ) ĊĠĠĠ Ġex clusions _ av _ dog sex clude d . load Ad ( dog s Excluded Request ) ĊĠĠĠ Ġex clusions _ av _ cat sex clude d . load Ad ( cats Excluded Request ) ĊĠ Ġ} Ċ } Ċ