0

Hello I want to send file from my phone using intent. I get file patch in this way:

Intent get=new Intent();
                get.setAction(Intent.ACTION_GET_CONTENT);
                get.setType("*/*");
                startActivityForResult(get,2);

and I receive path and send file in this way:

 if (requestCode == 2)
            {
                path = data.getData();

                Log.d("PATH", path.getPath());
                Intent send=new Intent();
                send.setAction(Intent.ACTION_SENDTO);
                send.setType("*/*");
                send.putExtra(Intent.EXTRA_STREAM,path);
                //startActivity(Intent.createChooser(send,"Sending"));
            }

Everything would be right but when I send file, it has an odd name, eg: orca_share_media1496666382761 how can I change the file name to be as it should be? I found different solution but there path was in String

Michał Urban
  • 113
  • 12

1 Answers1

0

I think you should rename file before sending if you want this to work. Here is some reference on how to do that android, How to rename a file?

Robert K.
  • 1,043
  • 1
  • 8
  • 20