android - Recyceler View on device rotation replication -




in application, there recycler view in fragment

when follow following steps got duplicated in nexus 6 5.1.1 device 1)change device orientation landscape 2)lock device 3)change device orientation portrait 4) unlock device 1 sec there replication of view

i have setretaininstance = true in fragment

and

 getsupportfragmentmanager().begintransaction() .add(getcontentframe(),fragment,fragment.getclass().getname())                         .addtobackstack(fragment.getclass().getname())                         .commit(); 

for adding fragment

before rotation after rotation

you need use 2 things:

onsaveinstancestate onrestoreinstancestate

check documentation





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -

python - Read npy file directly from S3 StreamingBody -