android - How to make ViewHolder listen to screen orientation change? -


i want notify viewholder of recyclerview when screen orientation changed. can notify viewholder on screen. ones out of screen don't know how notify them. please help.

add activity orientation changing :

@override public void onconfigurationchanged(configuration newconfig) {     super.onconfigurationchanged(newconfig);     if (newconfig.orientation == configuration.orientation_portrait) {         //portrait mode         adapter.screenchanged("portrait");     } else if (newconfig.orientation == configuration.orientation_landscape) {         //landscape mode         adapter.screenchanged("landscape");     } } 

add adapter

 public void screenchanged(string orientation){         if (orientation.equals("portrait")){             //code         }else{             //code         }     } 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -