What items i need to dispose in each activity for free memory?
I'm using recyclerview,listview,textview,edidtext and buttons.
Is it good practice to set them null on destroy method?
private List<InventoryPreviewClass> mItems;
private ListView mlistview;
private EditText mSearch;
private EditText etSearchAlwaysOn;
private LinearLayout mContainer;
private bool mAnimatedDown;
string dpPath;
private bool mIsAnimating;
private MyListViewAdapterInventory mAdapter;
SQLiteConnection db;
private TextView mTxtHeaderFirstName;
private TextView mTxtHeaderLastName;
private bool mFirstNameAscending;
private bool mLastNameAscending;
List<String> ID;
List<String> Name;
Spinner CategorySpinner;
protected override void OnDestroy()
{
base.OnDestroy();
mItems = null;
mlistview = null;
mSearch = null;
etSearchAlwaysOn = null;
mContainer = null;
dpPath = null;
mAdapter = null;
db = null;
mTxtHeaderFirstName = null;
mTxtHeaderLastName = null;
ID = null;
Name = null;
CategorySpinner = null;
}
Is there need to dispose them all? Or it will automatically dispose those items if there no in use?