why does R does not exist error come in android?

前端 未结 7 1067
谎友^
谎友^ 2020-12-16 14:45
packages/apps/Myfolder/src/com/android/myfolder/MyFile.java:196: package R does not exist
                  addPreferencesFromResource(R.xml.myfile);
                        


        
7条回答
  •  半阙折子戏
    2020-12-16 15:32

    Also make sure to include your current Activity in the AndroidManifest.xml, inside the application tags. So if MyFile is your Activity subclass, you should have something like this in it:

    
    
            
                 
                     
                 
            
            ..
    
    
    
    

    Although what's actually in there depends on your activity. More information about this at: http://developer.android.com/guide/topics/manifest/manifest-intro.html

提交回复
热议问题