进口android.os.ServiceManager不能得到解决 [英] The import android.os.ServiceManager cannot be resolved
问题描述
我使用AIDL接听来电自动的,code如下:
I'm using aidl to answer call automagically, code as following:
ITelephony.Stub.asInterface(ServiceManager.getService("phone"))
.answerRingingCall();
我导入ServiceManager.class
I import ServiceManager.class
import android.os.ServiceManager;
但有一个问题:进口android.os.ServiceManager不能得到解决。
but there's a problem:The import android.os.ServiceManager cannot be resolved
我怎样才能使它发挥作用?谢谢
How can I make it work? Thanks
推荐答案
您好ITelephony是不公开的API的一部分,继承人的<一个href="http://www.kiwidoc.com/java/l/x/android/android/5/p/com.android.internal.telephony/c/ITelephony"相对=nofollow>资源。
Hello ITelephony is not part of public API, heres the resource.
创建一个包目录自己,请参阅<一个href="http://$c$c.google.com/p/auto-answer/source/browse/trunk/src/com/#com/android/internal/telephony"相对=nofollow>这个
Create a package directory yourself, refer to this
让我知道它的工作原理,我还没有尝试过呢!
Let me know it it works, I haven't tried it yet!
这篇关于进口android.os.ServiceManager不能得到解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!