mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-14 07:05:40 -04:00
Fix[modloader]: move detachments into onStop()
Some actions executed by the futures or the ModloaderDownloadListener may invoke operations which can only be performed when the fragment state is not yet saved. So this commit moves them into onStop, which is executed before saving the state. For reference: https://developer.android.com/static/images/guide/fragments/fragment-view-lifecycle.png
This commit is contained in:
parent
322837e533
commit
781a31a2d9
@ -82,14 +82,14 @@ public abstract class FabriclikeInstallFragment extends Fragment implements Modl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
public void onStop() {
|
||||
cancelFutureChecked(mGameVersionFuture);
|
||||
cancelFutureChecked(mLoaderVersionFuture);
|
||||
ModloaderListenerProxy proxy = getListenerProxy();
|
||||
if(proxy != null) {
|
||||
proxy.detachListener();
|
||||
}
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
private void onClickStart(View v) {
|
||||
|
@ -58,10 +58,10 @@ public abstract class ModVersionListFragment<T> extends Fragment implements Runn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
public void onStop() {
|
||||
ModloaderListenerProxy taskProxy = getTaskProxy();
|
||||
if(taskProxy != null) taskProxy.detachListener();
|
||||
super.onDestroyView();
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user