I have a question regarding memory leaks. I have the below anonymous class. As you might know anonymous class hold reference from the outside object(here is Activity). Does this code causes memory leak or not? In case of orientation this will hold the old activity. Right?
Thank you
public class MainActivity extends AppCompatActivity{
recyclerview.post(new Runnable() {
@Override
public void run() {
// Notify adapter with appropriate notify methods
adapter.notifyItemRangeInserted(curSize, allContacts.size() - 1);
}
});
}