Use FragmentManager
's findFragmentById()
to check what fragment is currently displayed, and switch
for the fragment inside the onKeyDown
function
How to use different onKeyDown in fragment of a same activity
-
02-06-2022 - |
Pergunta
I want to use different onKeyDown or onKeyUp in different fragment,but the method is written in the activity.So I want to find a way to write different onKeyDown.
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow