如何从SD卡中获取文件夹中的所有歌曲

时间:2015-07-17 10:26:07

标签: android

通过使用MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,我将获取存储在卡中的所有音频文件。但我想只获取文件夹MUSIC的内容。

如何从SD卡中获取MUSIC文件夹中的所有歌曲?

1 个答案:

答案 0 :(得分:0)

您可以使用以下代码从特定文件夹中获取音频

        ***html***

<!DOCTYPE html>
<html>
<head>
<Title>Stuff</Title> 
<link rel="stylesheet" type="text/css" href="mainPage.css">
<meta charset="UTF-8">
<meta name="description" content="Stuff">
<meta name="keywords" content="Stuff">
</head>
<body>
<div id ="pageWrapper">
<div id="headerWrapper">
<div id="headerTransparentDiv">


<div id="Title">
   <p>Stuff</p>  <!--The problem is when I added the <p> tag a white space appeared on top of the page-->
</div>

     <div id ="menuBar">
         <div class="menuItems">

         </div>
     </div>

    </div>
  </div>

     <div ="mainContentWrapper">

     </div>

     <div id="footer">

     </div>
  </div>

  </body>
  </html>


    ***css***

body{margin:0; padding:0;   }
#pageWrapper{width:100%;height:1000px;background-color:black; background-    image: url("https://darthmojo.files.wordpress.com/2009/03/bsg-stars.png");background-size: 100% 100%;
background-repeat:no-repeat;}
#headerTransparentDiv{
height:100%; width:100%; background: rgba(0, 0, 100, 0.2);
 }
#headerWrapper{

position:relative;
margin-right:auto;
margin-left:auto;
background-image: url("http://horoscopespot.net/wp-content/gallery/pisces/pisces-shadow.jpg");
width:85%;
height:800px;
background-size: 100% 100%;
background-repeat:no-repeat;
  }

#Title{width:100px;height:100px; position:relative;left:100px;top:100px;}
#Title p{font-size:50px; color:white; 
text-shadow:0 0 10px white,  0 0 20px white, 0 0 30px white,  0 0 40px   #00FFFF, 0 0 70px #00FFFF,  0 0 80px #00FFFF,  0 0 100px #00FFFF,  0 0 150px  #00FFFF;}

只需将YourFolderNameHere替换为MUSIC或您需要的任何文件夹