Guest User

Untitled

a guest
Oct 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. android:windowSoftInputMode="adjustPan"
  2.  
  3. @Override
  4. public void onResume() {
  5. super.onResume();
  6. getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
  7. }
  8.  
  9. @Override
  10. public void onPause() {
  11. super.onPause();
  12. getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_UNSPECIFIED);
  13. }
  14.  
  15. myFragment.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
  16.  
  17. @Override
  18. protected void onCreate(@Nullable Bundle savedInstanceState) {
  19. super.onCreate(savedInstanceState);
  20. setContentView(R.layout.my_layout);
  21.  
  22. getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
  23. }
Add Comment
Please, Sign In to add comment