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
Post a Comment