I am trying to open a intent that lets me choose a file. Im able to select a file but when I try creating a file with the Uri I got in the OnActivityResult method I get a file size of 0. I dont think Im getting the right file path.
File file = new File(Environment.getExternalStorageDirectory().getPath()+"/TESTAPP4");
Intent intent = new Intent();
intent.setAction(Intent.ACTION_GET_CONTENT);
Uri data = Uri.fromFile(file);
String type = "*/*";
intent.setDataAndType(data, type);
startActivityForResult(intent, 12);
onActivityResult:
Uri u= data.getData();
File file = new File( u.getpath);
file.length() // give 0