原始回答:
If you include the second project as a library, you might not want to create a new resource folder as suggested in a previous answer (which does work). Instead, you can simply add the library’s resource folder to your resource directories in your module’s build.gradle: to the android section add
sourceSets {
main.resources.srcDirs += ‘path/to/your/libs/res’
}
If now the added res folder contains org/mypackage/Bundle.properties you can refer to it using
ResourceBundle.getBundle(“org.mypackage.Bundle”)
Actually adding a new resource folder does nothing more then adding it as a resource directory in build.gradle.
实例:
例如
则:我用的是相对路径,
sourceSets {
main.resources.srcDirs += ‘src/main/java’
}
注意build.gradle的选择
然后就可以找到bundle了