Monday, April 16, 2012

application not working on android 4.0.4

i was working on a media player app on 2.2 that worked fine on my phone nexus S on 2.3.6 i upgraded my phone to ice cream sandwich 4.0.4 it's not working anymore when i commented this portion of code it worked what's the problem with this code :



public void loadfiles()
{
File file = new File("/sdcard");
String [] liste;
liste=file.list();
String txt=new String("");
db.begin_transaction();
for(int i=0;i<liste.length;i++){
File file1 =new File("/sdcard/"+liste[i]);
if (file1.isDirectory()&&(i!=liste.length-2)){search("/sdcard/"+liste[i]);}}
db.end_transaction();
}
public void search(String url)
{
File file = new File(url);
String [] liste;
liste=file.list();
String txt = new String("");
for(int i=0;i<liste.length;i++)
{
File file1 =new File(url+"/"+liste[i]);
if (file1.isDirectory()){search(url+"/"+liste[i]);}
else if(liste[i].endsWith(".mp3"))
{
//HashMap<String, String> info = MP3HeaderInfo.getInfo(file.getAbsolutePath()+"/"+liste[i]);

//db.insererUneChanson((liste[i]).substring(0,liste[i].length()-4),file.getAbsolutePath()+"/"+liste[i],info.get("Artist"),info.get("Album"),info.get("Year"));

}
}




No comments:

Post a Comment