I have this code that I have semi working. I want it to pull up a file selector and then return the file chosen into a manipulable format. Maybe File
or String
.
I read the Android Documentation on how to call this and I still don't understand intents and how to use them.
I'm used to calling a function and then setting the return to a variable and working from there.
I don't know how to set this up in order to do it. I know about some users possibly not having a file explorer, but all my users will.
So how do I get this code to function? When it returns, it does nothing at the moment.
chooseFileButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
EditText enterZipEditText = (EditText) findViewById(R.id.enterZipEditText);
Intent intent = new Intent();
intent.setType("zip/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Choose File"), REQUEST_CODE);
}
});