1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Remove reference to NonConfigurationInstance when no longer needed

This commit is contained in:
cketti 2011-10-14 04:15:45 +02:00
parent 5b81dbc2ed
commit fd16ff8fe6

View File

@ -923,7 +923,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
@Override
public void restore(Activity activity) {
show(activity);
show((Accounts) activity);
}
@Override
@ -936,7 +936,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
return false;
}
public void show(final Activity activity) {
public void show(final Accounts activity) {
final String message = activity.getString(mMessageRes, mArguments);
final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
@ -947,16 +947,11 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
destroy();
activity.setNonConfigurationInstance(null);
}
});
mDialog = builder.show();
}
private void destroy() {
mDialog = null;
mArguments = null;
}
}
private void showImportSelectionDialog(ImportContents importContents, Uri uri,
@ -1071,7 +1066,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
boolean overwrite = false;
dialog.dismiss();
destroy();
activity.setNonConfigurationInstance(null);
ImportAsyncTask importAsyncTask = new ImportAsyncTask(activity,
includeGlobals, accountUuids, overwrite, mEncryptionKey, mUri);
@ -1084,20 +1079,11 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
destroy();
activity.setNonConfigurationInstance(null);
}
});
mDialog = builder.show();
}
private void destroy() {
mDialog = null;
mImportContents = null;
mUri = null;
mEncryptionKey = null;
mSelection = null;
mImportSelectionView = null;
}
}
private void setNonConfigurationInstance(NonConfigurationInstance inst) {
@ -1435,6 +1421,9 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
} catch (FileNotFoundException e) {
Log.w(K9.LOG_TAG, "Couldn't open import file", e);
return false;
} catch (Exception e) {
Log.w(K9.LOG_TAG, "Unknown error", e);
return false;
}
return true;
}