How to import class from another module in android studio?
Make sure of the following:
In settings.gradle, you should have: include ':x', ':y'
.
In x/build.gradle, you should add y as a dependency:
dependencies {
compile project(':y')
// other dependencies
}
Now when you create new module,the settings.gradle file add automatically this module.After that u should add this line:
dependencies {
implementation(
...,
..,
project(":y")
)
}