2014-02-20 68 views
-1

我想打開命名爲'歌曲'的文件夾是在SD卡上創建的按鈕點擊..請任何機構幫我做到這一點如何從存儲卡上打開一個文件夾的按鈕點擊

open.setOnClickListener(new OnClickListener() 
    { 

     @Override 
     public void onClick(View arg0) 
      { 
      Intent intent = new Intent(Intent.ACTION_GET_CONTENT); 
      Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath() + "Songs"); 
      intent.setDataAndType(uri); 
      startActivity(Intent.createChooser(intent, "Open")); 
     } 

回答

1

試試這個:

public void Folder() 
{ 
Intent intent = new Intent(Intent.ACTION_GET_CONTENT); 
Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath() 
    + "/Songs/"); 
intent.setDataAndType(uri, "*/*"); 
startActivity(Intent.createChooser(intent, "Open")); 
} 
相關問題