Can you load a drawable from a sub directory in the assets
(not the drawable folder) folder?
Right click on the assets folder, select New >> file (myText. txt) and your text. “Darkness cannot drive out darkness: only light can do that. Hate cannot drive out hate: only love can do that.”
Drag and drop your images directly onto the Resource Manager window in Android Studio. Alternatively, you can click the plus icon (+), choose Import Drawables, as shown in figure 3, and then select the files and folders that you want to import. Figure 3: Select Import Drawables from the dropdown menu.
Step 1: To create an asset folder in Android studio open your project in Android mode first as shown in the below image. Step 2: Go to the app > right-click > New > Folder > Asset Folder and create the asset folder. Step 3: Android Studio will open a dialog box. Keep all the settings default.
Assets provide a way to include arbitrary files like text, xml, fonts, music, and video in your application. If you try to include these files as "resources", Android will process them into its resource system and you will not be able to get the raw data.
Hope this help:
Drawable d = Drawable.createFromStream(getAssets().open("Cloths/btn_no.png"), null);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With