package Ġcom . permission x . android Little Bo y Ċ Ċ import Ġandroidx . fragment . app . Fragment Activity Ċ Ċ object ĠPermission X Ġ{ ĊĠĠĠ Ġprivate Ġconst Ġval ĠTAG =" In visible Fragment " ĊĠĠĠ Ġfun Ġrequest ( activity : Fragment Activity , var arg Ġpermissions : String , callback : Permission Callback ){ ĊĠĠĠĠĠĠĠ Ġval Ġfragment Manager = activity . support FragmentManager ĊĠĠĠĠĠĠĠ Ġval Ġexisted Fragment = fragment Manager . find Fragment By Tag ( TAG ) ĊĠĠĠĠĠĠĠ Ġval Ġfragment = if Ġ( exist ed Fragment != null ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġexisted Fragment Ġas ĠIn visible Fragment ĊĠĠĠĠĠĠĠ Ġ} else { ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġinvisible Fragment = In visible Fragment () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfragment Manager . beginTransaction (). add ( invisible Fragment , ĠTAG ). commit Now () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġinvisible Fragment ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġfragment . request Now ( callback ,* permissions ) ĊĠĠĠ Ġ} Ċ }