Can the Android drawable directory contain subdirectories?

后端 未结 21 944
醉梦人生
醉梦人生 2020-11-22 04:13

In the Android SDK documentation, all of the examples used with the @drawable/my_image xml syntax directly address images that are stored in the res/drawable directory in my

21条回答
  •  抹茶落季
    2020-11-22 04:38

    Use assets folder.

    sample code:

    InputStream is = null;
    try {
        is = this.getResources().getAssets().open("test/sample.png");
    } catch (IOException e) {
        ;
    }
    
    image = BitmapFactory.decodeStream(is);
    

提交回复
热议问题