Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从非电话应用程序检查电话当前是否处于活动状态?
我需要什么 API 来检测这个?
尝试这个:
public boolean isCallActive(Context context){ AudioManager manager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); return manager.getMode() == AudioManager.MODE_IN_CALL; }