Android: Including multiple Java Packages to Manifest

前端 未结 5 961
执笔经年
执笔经年 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 04:58

    The problem may persist even if we change the manifest file. to avoid it we must Add an import com.example.R; in all our classes.

    example: MainActivity.class in package2

    pakage com.example.package2.Activity2
    import com.example.R;
    

    (TestActivity.class in package1)

    pakage com.example.package1.Activity1
    import com.example.R;
    

提交回复
热议问题