public static class MyFragment extends Fragment {  
     @Override  
     public void onResume() {  
       super.onResume();  
       getView().setFocusableInTouchMode(true);  
       getView().requestFocus();  
       getView().setOnKeyListener(new View.OnKeyListener() {  
         @Override  
         public boolean onKey(View v, int keyCode, KeyEvent event) {  
           //YOUR CODE  
           return false;  
         }  
       });  
     }  
   }  
Hello everyone, The purpose of this blog is to give you all kind of technical support in simple manner. Find latest technology support every time so as to keep you updated on daily basis. Exact source code snippet will help you understand more and integrate same in difficult situation. Note: Blog is maintained by Nikhil Lotke.
Tuesday, January 31, 2017
Handle onKeyListener in Fragment – Android
Labels:
android
Subscribe to:
Post Comments
                                      (
                                      Atom
                                      )
                                    
 
No comments :
Post a Comment