Select File from file manager via Intent

后端 未结 2 1637
攒了一身酷
攒了一身酷 2021-02-20 08:31

What I wanna do:

I wanna get the path as a String of a file, which I choose via an Android File Manager.

What I have:



        
2条回答
  •  时光取名叫无心
    2021-02-20 08:42

    So for my Samsung device this worked:

    Intent intent = new Intent("com.sec.android.app.myfiles.PICK_DATA");
    intent.putExtra("CONTENT_TYPE", "*/*");
    intent.addCategory(Intent.CATEGORY_DEFAULT);
    startActivityForResult(intent, FILE_SELECT_CODE);
    

提交回复
热议问题