i am new user of android and i had make one android database connection and create table application but at run time it will generate an error.
an error is hear :
@Override
public void onDestroy() {
super.onDestroy()
eventsData.close();
}
I found a solution for my situation, where I wanted to have the tab bars animate away before allowing the onDestroy() to continue. SuperNotCalledException will be thrown only if the inaccessible mCalled field is not set by super.onDestroy(), but digging in the source revealed that the public method super.onDestroyView() ONLY sets this field -- so I did the following to allow actual super.onDestroy() to be called in an endAction (am using RetroLambda) :
@Override
public void onDestroy() {
super.onDestroyView(); //Calling this public method will prevent the android.support.v4.app.SuperNotCalledException when we don't immediately call the super.onDestroy - since it is in an endAction
removeHeaderView(super::onDestroy);
}
Hope this helps someone else!
public void onDestroy() {
super.onDestroy();
eventsData.close();
}
This is to be called because, Activity class in android does some cleanup by itself. When base class functions are overridden by the derived class that is the activity as done in case of onDestroy(), the base class function needs to be called explicitly to perform the expected operation.
I added this line and everything worked fine:
super.onCreate(savedInstanceState);
Added it to the first line in OnCreate()
method.
Add this code for onDestroy() method.
super.onDestroy();
It worked for me.