1. Introducing Channels - a new way to chat with other Android users!
    Dismiss Notice

Unable to enumerate files


Last Updated:

  1. jacks sparrow

    jacks sparrow New Member This Topic's Starter

    Joined:
    Sep 17, 2010
    Messages:
    3
    Likes Received:
    0
    Hello,

    I am newbie in Android world. I have created simple application which enumerates the files in the android device. In the my emulator (file explorer) there is folder named "Data". I unable to enumerate this folder. I simply called listFiles() method.

    Following is the code. It is showing logs as listFiles failed. But when I tried to get the files under the /data/anr folder, I am getting it.

    I didn't understood such behaviour.


    String m_file_test = "/data";


    File m_file_list[] = m_file_test.listFiles();
    if (null == m_file_list)
    {
    Log.i("Fail", "listFiles failed");
    return;
    }

    int iTotal = m_file_list.length;

    for (iCnt = 0; iCnt < iTotal; ++iCnt)
    {
    Log.i("File Found = ", m_file_list[iCnt].getAbsolutePath());

    }
     

    Advertisement

Share This Page

Loading...