This is due to setup incorrect target build settings. Target build was set toAndroid 2.1 (SDK v7) where his layout XML used Android 2.2 (SDK v8) elements (layout parameter
match_parent
), due to this there was no way for Eclipse to correctly generate the R.java file which caused all the problems.Solution:
- Remove import android.R.*
- Project->Clean , to regenerate R.java
沒有留言:
張貼留言