I\'ve read that setting .setOnRetainInstance(true) on fragments presenting UI may lead to memory leaks.
.setOnRetainInstance(true)
Could somebody please explain why and how this
you can overide onDestroy() and invoke garbage collector.
onDestroy()
@Override public void onDestroy() { super.onDestroy(); System.gc(); System.gc(); }