Fix file import, commitAllowingStateLoss() was he answer to fragment crashes, PS: I hate fragment lifecycles...

This commit is contained in:
Dominik Schürmann
2013-09-22 21:50:46 +02:00
parent 2e83d92dd0
commit b5c0e4478c
5 changed files with 122 additions and 87 deletions

View File

@@ -95,18 +95,19 @@ public class ImportKeysFileFragment extends Fragment {
switch (requestCode) {
case Id.request.filename: {
if (resultCode == Activity.RESULT_OK && data != null) {
String path = null;
try {
String path = data.getData().getPath();
path = data.getData().getPath();
Log.d(Constants.TAG, "path=" + path);
// set filename to edittext
mFilename.setText(path);
// load data
mImportActivity.loadCallback(null, path);
} catch (NullPointerException e) {
Log.e(Constants.TAG, "Nullpointer while retrieving path!", e);
}
// load data
mImportActivity.loadCallback(null, path);
}
break;