Closed bettinasmid closed 3 years ago
If you look at the function in the file MainActivity.java
, the constant is actually named as _REQ_UNICORNFILE which is defined in the file Constants.java
Just replace the variable REQUEST_CODE_CHOOSE in your kotlin code with REQ_UNICORN_FILE ( don't forget to import the variable).
Thanks a lot! Then the description in the Readme might be inaccurate?
Actually, the request code in the readme demonstrates that you can put whatever integer constant you want in place. Glad I could be of help. I will be closing this issue now. Thank you.
Hi, I'm writing my program in Kotlin, so I had it translated by AndroidStudio, but the IDE cannot recognize this constant. Where do I find the declaration? The Kotlin adaptation of the function is below:
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == _REQUEST_CODECHOOSE && resultCode == RESULT_OK) { val files = data?.getStringArrayListExtra("filePaths") for (file in files!!) { Log.e("tag",file) } } }
Thanks a lot in advance!