How I could add R.raw class to my android project? Now I haven't /res/raw folder at all (and class as well). And I can't find any tools in eclipse to do that. So how to add R.raw?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
You may have to restart android studio if above solutions aren't working, i restarted it and then it works.
You need to right-click on res->new->Android resource directory. Make sure you select directory and not file.
Select raw in resource type and it automatically selects raw as the directory name.
Drag and drop your .mp3 music file inside the res folder. Make sure that it starts with a small letter.
Try putting a
+
beforeR.xyz
. That should start showing additional folders, e.g.:If you have a
res/raw
folder, be sure to add a file with a valid filename, otherwise the entire folder won't show up in the R class. If there's an error with a filename, it will appear in red in the console.Using IntelliJ Idea:
1) Invalidate Caches, and 2) right click on resources, New Resources directory, type = raw 3) build
note in step 2: I was concerned that simply adding a raw directory wouldn't be enough...
The
R
class is written when you build the project in gradle. You should add theraw
folder, then build the project. After that, theR
class will be able to identifyR.raw.*
.