package Ġorg . w ats i . u hp . managers Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . view . View Ċ import Ġandroid . view . input method . Input Method Manager Ċ Ċ class ĠAndroid Keyboard Manager ( context : ĠContext ) Ġ: ĠKeyboard Manager Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġinput Method Manager Ġ= Ġcontext . getSystem Service ( Context . INPUT _ METHOD _ SERVICE ) Ġas ĠInput Method Manager ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠRequest Ġfocus Ġbefore Ġshowing Ġkeyboard Ġbecause Ġthere Ġare Ġno Ġcases Ġwhere Ġit Ġmakes Ġsense ĊĠĠĠĠ Ġ* Ġto Ġshow Ġa Ġkeyboard Ġwithout Ġa Ġcorresponding Ġfocused Ġview Ġthat Ġis Ġaccepting Ġthe Ġinput ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġoverride Ġfun Ġshow Keyboard ( view : ĠView ) Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( view . request Focus ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġinput Method Manager . show Soft Input ( view , ĠInput Method Manager . SHOW _ IMP LICIT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġhide Keyboard ( view : ĠView ) Ġ{ ĊĠĠĠĠĠĠĠ Ġinput Method Manager . hide Soft Input From Window ( view . window Token , ĠInput Method Manager . HIDE _ NOT _ ALWAYS ) ĊĠĠĠ Ġ} Ċ } Ċ