-1

I'm using Assets folder for files storing. And added file

ten_ways

manually to this folder. But when I display the list of files of this folder with the help of this code

AssetManager manager = getApplicationContext().getAssets();
        try {
            String[] files = manager.list("");
            Toast.makeText(getApplicationContext(),files[0],Toast.LENGTH_SHORT);
        } catch (IOException e) {
            e.printStackTrace();
        }

Nothing is shown. I understand that it means that there's nothing in this folder, but why?

Here's the struct of the directories:

enter image description here

1 Answers1

2

Common mistake when using Toast. You forgot to show it:

Toast.makeText(getApplicationContext(),files[0],Toast.LENGTH_SHORT).show();
Bruno
  • 3,872
  • 4
  • 20
  • 37