Android studio create directories

1

How can I create a folder in android studio (to save images - my project will have lots of images and would like to split into folders or packages for better organization)? If I create in the directory option it creates the actual folder, but does not create in the folder tree on the left side. It was creating within the drawable.

    
asked by anonymous 30.10.2015 / 17:20

1 answer

1

You can add in the assets folder, and there create sub-directories

To load from the assets:

   try {
    // carrega a imagem
    InputStream ims = getAssets().open("pasta1/img1.jpg");
    // Transforma em Drawable
    Drawable d = Drawable.createFromStream(ims, null);
    // set image to ImageView
    //mImage.setImageDrawable(d);
}
catch(IOException e) {

}
    
30.10.2015 / 19:04