0

如果我的电话到达其他语音信箱,我想启动其他一些应用程序。如何在android中检测到它?谢谢

4

1 回答 1

0

你可以收听 LISTEN_MESSAGE_WAITING_INDICATOR 的广播然后采取行动

http://developer.android.com/reference/android/telephony/PhoneStateListener.html#LISTEN_MESSAGE_WAITING_INDICATOR

您将扩展 PhoneStateListener,然后初始化该类

public class VoicemailListener extends PhoneStateListener {

  private final Context context;

  public VoicemailListener(Context context) {
    this.context = context;
  }

  @Override
  public void onMessageWaitingIndicatorChanged(boolean mwi) {
              //Message Recieved, do your work here
  }
}
于 2012-08-22T19:21:18.613 回答