Why Is My Layout Unable To Be Resolved? (android/java)
Well, my program has been working so far, staying compilable and everything, and I tried to add a sound to it, so I created a folder 'raw', and stuck in the mp3 file. Then I tried
Solution 1:
See at the top?
import android.R;//Don't use android.R here; use a fully qualified name for each usage instead - this one only comes up *sometimes...
You should probably heed what that comment says. ;) Remove the import for android.R
, and it will use your project's R
file instead, which is where activity_login
is.
Solution 2:
You're importing the wrong R.java
. You should be importing the one that is generated by Eclipse (in your gen folder). You can auto-import this by typing control-shift-o
. You may also need to run Project>Clean, which is sometimes needed when adding assets.
As for the raw folder, be sure it is placed under the res/
directory.
Post a Comment for "Why Is My Layout Unable To Be Resolved? (android/java)"