title: How to do file open dialog
body: <p>I just started developing android app on windows platform with Android 2.1.  I have run into an issue for opening a file dialog that allows a user to choose a file from sdcard or from the android phone. I am using an emulator API level 7 and platform 2.1 update.  I have a sample code here that I am using. But it doesn't work. Can anybody take a look at it and correct it?   Thank you.</p>
  
  <pre><code>    button1.setOnClickListener(new OnClickListener() {
      int PICK_REQUEST_CODE = 0;
  
      @Override
      public void onClick(View v) {
      System.out.println("Button is clicked.");
  
      Intent intent = new Intent();
      intent.setAction(Intent.ACTION_PICK);
      Uri startDir = Uri.fromFile(new File("/"));
      // Files and directories !
      intent.setDataAndType(startDir,
          "vnd.android.cursor.dir/lysesoft.andexplorer.file");
      // Title
      intent.putExtra("explorer_title", "Select a file");
      // Optional colors
      intent.putExtra("browser_title_background_color", "440000AA");
      intent.putExtra("browser_title_foreground_color", "FFFFFFFF");
      intent.putExtra("browser_list_background_color", "00000066");
      // Optional font scale
      intent.putExtra("browser_list_fontscale", "120%");
      // Optional 0=simple list, 1 = list with filename and size, 2
      // = list with filename, size and date.
      intent.putExtra("browser_list_layout", "2");
      startActivityForResult(intent, PICK_REQUEST_CODE);
  
      }
  </code></pre>