The android docs on Bound Services show "no access modifier", resulting in package level scope when defining getService()
. For example:
<!-- language: lang-java -->
public class LocalBinder extends Binder {
LocalService getService() {
return LocalService.this;
}
}
I am working on refactoring my code into packages, so I may re-use it in another app, but have hit compile errors stating, "method getService() from the type foo.LocalBinder is not visible".
I've not been able to find the reference declaration of getService()
. Am I risking running into problems if I open the scope, such as:
<!-- language: lang-java -->
public LocalService getService() {
...
I am only using the service locally within my own app, and I have android:exported="false"
declared in my AndroidManifest.xml
.