@@ -32,7 +32,8 @@ public class SelectPath extends Fragment implements BackButtonHandler, OnClickLi
3232 private transient EditText editFileName ;
3333 private transient EditText editPassword ;
3434 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 ();
3637 private String filename = new SimpleDateFormat ("yyyyMMdd_HHmm" ).format (new Date ()) + "_rust_keylock" ;
3738 private int FRAGMENT_CODE_DIR = 11 ;
3839 private int FRAGMENT_CODE_FILE = 33 ;
@@ -61,6 +62,17 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
6162 return rootView ;
6263 }
6364
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+
6476 private void initialize (View view ) {
6577 TextView title = (TextView ) view .findViewById (R .id .selectPathLabel );
6678 if (export ) {
@@ -80,7 +92,6 @@ private void initialize(View view) {
8092 this .editPath = editPath ;
8193
8294 EditText editFilename = (EditText ) view .findViewById (R .id .editFileName );
83- filename = export ? filename : "" ;
8495 editFilename .setText (filename );
8596 editFilename .setEnabled (export );
8697 this .editFileName = editFilename ;
@@ -142,10 +153,15 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
142153 backButtonHandler = this ;
143154 super .onActivityResult (requestCode , resultCode , data );
144155 if (requestCode == FRAGMENT_CODE_DIR ) {
156+ Log .d (TAG , "Directory selector returned " + data .getStringExtra ("directory" ));
145157 workingDirectoryPath = data .getStringExtra ("directory" );
146158 filename = export ? filename : "" ;
147159 } else if (requestCode == FRAGMENT_CODE_FILE ) {
160+ Log .d (TAG , "File selector returned " + data .getStringExtra ("file" ));
148161 filename = data .getStringExtra ("file" );
162+ } else {
163+ Log .d (TAG , "Unhandled selector request code '" + requestCode
164+ + "'. Please consider opening a bug to the developers." );
149165 }
150166 }
151167
0 commit comments