I call the SQLite database method in my work. I cited the following code final DatabaseHandler db=new DatabaseHandler(Lists.this);to create an instance of the database in my Activity.I did not give the above code inside OnCreate (). I want the context to be null when calling the OnDestroy method. I have done the following:
@Override
protected void onDestroy() {
super.onDestroy();
System.gc();
details.clear();
DatabaseHandler db=new DatabaseHandler(null);
}
Is this the right way to make the context null?
source
share