[英]Use custom system service in app (Android Studio)
First of all, thank you for your help. 首先,谢谢您的帮助。
Here is my problem. 这是我的问题。
import android.os.BacklightManager; //My service manager name ... BacklightManager bm = (BacklightManager) getSystemService(BACKLIGHT_SERVICE); ... if(!bm.isBacklightOn()) { //Turn it on. } else { //Other Things... }
My problem occurs because Android Studio will not build the application due to not knowing what the BacklightManager is. 发生我的问题是因为Android Studio由于不知道BacklightManager是什么而无法生成应用程序。 How can I build this application to test my code?
如何构建此应用程序以测试我的代码? (import something into Android Manager, force a build ignoring errors, etc.)
(将某些内容导入Android Manager,强制构建忽略错误等)
It looks like the solution is to build a custom SDK within the AOSP build environment. 看来解决方案是在AOSP构建环境中构建自定义SDK。 And then import that into Android Studio
然后将其导入Android Studio
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.