문제

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.

도움이 되었습니까?

해결책

Use FragmentManager's findFragmentById() to check what fragment is currently displayed, and switch for the fragment inside the onKeyDown function

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top