Android: Including multiple Java Packages to Manifest

前端 未结 5 971
执笔经年
执笔经年 2020-12-05 04:22

The app I am developing has many activities organized into seven java packages. Originally I wrote all the coding and stuff for each group of activities in a java package as

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-05 05:09

    Make sure that the import statement at the top of the Activity references the correct R file. Each project has its own R file, so if you copy an Activity from one project to another it will still be trying to reference the R file from the old project.

    You do not need any explicit inclusion of different packages in the manifest. To include activities from two different packages, say:

    com.example.package1.Activity1
    com.example.package2.Activity2
    

    you can do the following:

    
      
        
        
      
    
    

提交回复
热议问题