Unverified Commit e5220480 authored by Pavitra Golchha's avatar Pavitra Golchha Committed by Jeffrey I. Schiller

Fix: OnDestroyListener doesn't fire

https://community.appinventor.mit.edu/t/ondestroy-not-fired/5341

Change-Id: Id4ed0ed02ab23cc33b904c90c3d41c702e4bc019
parent a63a8b78
...@@ -792,7 +792,6 @@ public class Form extends AppInventorCompatActivity ...@@ -792,7 +792,6 @@ public class Form extends AppInventorCompatActivity
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy();
// for debugging and future growth // for debugging and future growth
Log.i(LOG_TAG, "Form " + formName + " got onDestroy"); Log.i(LOG_TAG, "Form " + formName + " got onDestroy");
...@@ -802,6 +801,9 @@ public class Form extends AppInventorCompatActivity ...@@ -802,6 +801,9 @@ public class Form extends AppInventorCompatActivity
for (OnDestroyListener onDestroyListener : onDestroyListeners) { for (OnDestroyListener onDestroyListener : onDestroyListeners) {
onDestroyListener.onDestroy(); onDestroyListener.onDestroy();
} }
// call super method at the end to delegate the destruction of the app to the parent
super.onDestroy();
} }
public void registerForOnDestroy(OnDestroyListener component) { public void registerForOnDestroy(OnDestroyListener component) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment