Hello I am developing an app with firebase backend and I need to know how to improve performance in android because I am taking firebase instance and reference to some data in activity or fragment where I will to put its data, but if user rotates your device this activity or fragment is destroyed and when its is recreated is necessary takes firebase references again and pass it to recycler adapter and this may take unecessary process. I need to put firebase references in another place where it don't be lost when rotation or another situation happens.
There are a lot of options to keep data on configuration change just to mention a few:
some reading material:
http://www.androiddesignpatterns.com/2013/04/retaining-objects-across-config-changes.html
https://developer.android.com/guide/topics/resources/runtime-changes.html