简体   繁体   中英

How to select any file from recent and upload it on server?

i wanna upload files on server from android app. so User can pick any file from recent like image, doc or any PDF in android app and will upload on server.

So please tell me how to open that recent activity and select any file and how to upload it on server.

Please help me this very important for me.

you can use */* for open all files as in android.

Intent intent = new Intent();    
intent.setType("*/*");
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, getString(R.string.perform_action_with)), attachmentChoice);

note:where attachmentChoice is Constant .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM