@@ -32,7 +32,8 @@ public class SelectPath extends Fragment implements BackButtonHandler, OnClickLi
32
32
private transient EditText editFileName ;
33
33
private transient EditText editPassword ;
34
34
private transient EditText editNumber ;
35
- private String workingDirectoryPath = Environment .getExternalStoragePublicDirectory (Environment .DIRECTORY_DOWNLOADS ).getAbsolutePath ();
35
+ private String workingDirectoryPath = Environment .getExternalStoragePublicDirectory (Environment .DIRECTORY_DOWNLOADS )
36
+ .getAbsolutePath ();
36
37
private String filename = new SimpleDateFormat ("yyyyMMdd_HHmm" ).format (new Date ()) + "_rust_keylock" ;
37
38
private int FRAGMENT_CODE_DIR = 11 ;
38
39
private int FRAGMENT_CODE_FILE = 33 ;
@@ -61,6 +62,17 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
61
62
return rootView ;
62
63
}
63
64
65
+ @ Override
66
+ public void onResume () {
67
+ if (this .editFileName != null ) {
68
+ this .editFileName .setText (filename );
69
+ }
70
+ if (this .editPath != null ) {
71
+ this .editPath .setText (workingDirectoryPath );
72
+ }
73
+ super .onResume ();
74
+ }
75
+
64
76
private void initialize (View view ) {
65
77
TextView title = (TextView ) view .findViewById (R .id .selectPathLabel );
66
78
if (export ) {
@@ -80,7 +92,6 @@ private void initialize(View view) {
80
92
this .editPath = editPath ;
81
93
82
94
EditText editFilename = (EditText ) view .findViewById (R .id .editFileName );
83
- filename = export ? filename : "" ;
84
95
editFilename .setText (filename );
85
96
editFilename .setEnabled (export );
86
97
this .editFileName = editFilename ;
@@ -142,10 +153,15 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
142
153
backButtonHandler = this ;
143
154
super .onActivityResult (requestCode , resultCode , data );
144
155
if (requestCode == FRAGMENT_CODE_DIR ) {
156
+ Log .d (TAG , "Directory selector returned " + data .getStringExtra ("directory" ));
145
157
workingDirectoryPath = data .getStringExtra ("directory" );
146
158
filename = export ? filename : "" ;
147
159
} else if (requestCode == FRAGMENT_CODE_FILE ) {
160
+ Log .d (TAG , "File selector returned " + data .getStringExtra ("file" ));
148
161
filename = data .getStringExtra ("file" );
162
+ } else {
163
+ Log .d (TAG , "Unhandled selector request code '" + requestCode
164
+ + "'. Please consider opening a bug to the developers." );
149
165
}
150
166
}
151
167
0 commit comments