android - Is there a way to handle key pressing in the fragment? -


i have fragment gridview , textview want handle search button pressing. how can this? if bind onkeylistener fragment's layout never called.

my suggestion handle on activity side , delegate fragment. need override onsearchrequested (check docs) , invoke method on fragment tell search requested. after fragment can update accordingly.


Comments