Thursday, April 29, 2010

[android-developers] IllegalStateException


i have a custom view with BaseAdapter which list all my mp3 files in
SD card
it works great but the getCount have a problem if i want return the
size of my song list
indeed , i have a illegalStateException : "content of the adapter has
changed but ListView did not receive a notification....." It works
great if i choose another int number but i must have the size of my
song list

how can i fix this ?
thank you a lot for your help

public int getCount() {

Log.v(TAG, "count " + count);
return updateSongList();

public int updateSongList(){

File home=new File(MEDIA_PATH);
int positionCourante = 0;

if(home.listFiles(new test()).length >0){

for (File file:home.listFiles(new test())){

Log.v(TAG, "liste " + songs.get(songs.size()-1));





return positionCourante;

You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment