i have just started programming for android and i have a little question
i got a main activity that calls another activity like so:
public void onClick(View view) {
Intent myIntent = new Intent(view.getContext(), FilePicker.class);
startActivityForResult(myIntent, PICK_FILE);
}
this works fine and opens a new activity which is like a file manager where my user needs to select a file.
my question is this: how do i return the file (a file is another class i have called Option which holds all the file info)
can i return it to the main activity as an object?
or can i just return strings like the path to the file and its name?
this is my setresult code right now:
Intent intent = this.getIntent();
setResult(RESULT_OK, intent);
finish();
where do i add my object so it will return to the main activity?.
thanks!
Try below code