开发者

can we detect a key is pressed in fragments

开发者 https://www.devze.com 2023-04-02 15:20 出处:网络
I am developing an application in which I want to do some thing when a key is pressed. Can we implement in the fragments.

I am developing an application in which I want to do some thing when a key is pressed. Can we implement in the fragments.

I do not want to do anything in the activity.

Thanks in adv开发者_开发知识库ance.


You can detect this in the Activity your Fragment is a part of. Fragments are part of Activity, not vice versa.

0

精彩评论

暂无评论...
验证码 换一张
取 消