Fix misuse of AsyncTask (#8799)

This commit is contained in:
Linjie Pan 2019-09-19 06:37:06 +08:00 committed by sfan5
parent 4271889ef8
commit 6a7f5c0985

@ -53,6 +53,14 @@ public class MinetestAssetCopy extends Activity {
super.onResume();
makeFullScreen();
}
@Override
protected void onDestroy() {
super.onDestroy();
if (m_AssetCopy != null) {
m_AssetCopy.cancel(true);
}
}
public void makeFullScreen() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
@ -77,7 +85,7 @@ public class MinetestAssetCopy extends Activity {
return this;
}
private class copyAssetTask extends AsyncTask<String, Integer, String> {
private static class copyAssetTask extends AsyncTask<String, Integer, String> {
boolean m_copy_started = false;
String m_Foldername = "media";
Vector<String> m_foldernames;