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

Popular posts from this blog

All overlapping substrings matching a java regex -

c++ - Using OpenSSL in a multi-threaded application -

php - Deleting/Renaming a locked file -