Android openRawResource() not working for a drawable

后端 未结 3 416
终归单人心
终归单人心 2021-01-04 08:46

I\'m trying to create an input stream by doing this

InputStream is = (InputStream) getResources().openRawResource(R.drawable.image1);

but I

3条回答
  •  無奈伤痛
    2021-01-04 09:28

    @Broatian I don't currently have a res/raw folder. I found an alternative solution: is = context.getResources().openRawResource(+ R.drawable.image1); The + shows additional folders. Thanks for the help!

提交回复
热议问题