0

I am working on an android application in which user will open file manager on a button click to select file either from Internal memory or Sdcard. My code is working fine on some smartphones but not on all .if anyone knows how to open a file manager programatically which works on all smartphones fine please help me.

Below is my code for opening file manager

Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("/*");
Intent i = Intent.createChooser(intent, "Select File");
startActivityForResult(intent, RESULT_code);
bgs
  • 3,061
  • 7
  • 40
  • 58
SAAD NASEER
  • 43
  • 1
  • 4
  • Do you want to open any file manager? (Like a select file button) or open a specific file manager app? – Rotary Heart Jul 10 '13 at 08:14
  • yes i want to open android file manager – SAAD NASEER Jul 10 '13 at 08:23
  • You do realize that some devices doesn't have a File Manager apk installed right? – Rotary Heart Jul 10 '13 at 08:31
  • I am actually having problem on Samsung galaxy devices.I want to know is there any way for opening file manager,internal memory or sdcard which works on all devices fine. – SAAD NASEER Jul 10 '13 at 08:35
  • What I'm trying to tell you is that if the device DOESN'T have any File Manager app it will not open anything (since it doesn't exist) so you need to check if those devices have any File Manager app AND not every File Manager app have the option to open a file. – Rotary Heart Jul 10 '13 at 08:37
  • ok got it , so how can i solve my problem? any suggesttion? – SAAD NASEER Jul 10 '13 at 08:48
  • Elaborate your file selection class, it shouldn't be hard since you don't have to include all the options that a File Manager app have. – Rotary Heart Jul 10 '13 at 08:49

0 Answers0