贝娄我的代码是登录 twilio 客户端正在工作
public void login(final String clientName,
final boolean allowOutgoing,
final boolean allowIncoming) {
if (loginListener != null)
loginListener.onLoginStarted();
this.lastClientName = clientName;
this.lastAllowOutgoing = allowOutgoing;
this.lastAllowIncoming = allowIncoming;
if (!twilioSdkInited) {
if (twilioSdkInitInProgress)
return;
twilioSdkInitInProgress = true;
Twilio.setLogLevel(Log.DEBUG);
Twilio.initialize(context, new Twilio.InitListener() {
@Override
public void onInitialized() {
Log.e(TAG, "onInitialized");
twilioSdkInited = true;
twilioSdkInitInProgress = false;
obtainCapabilityToken(clientName, allowOutgoing, allowIncoming);
}
@Override
public void onError(Exception error) {
Log.e(TAG, "onInitialized onError :" + error.toString());
Log.e(TAG, " onInitialized onError : isTokenExpired is Blank");
twilioSdkInitInProgress = false;
if (loginListener != null)
loginListener.onLoginError(error);
}
@Override
protected void finalize() throws Throwable {
Log.e(TAG, "@call finalize()");
if (device != null)
device.release();
if (connection != null)
connection.disconnect();
super.finalize();
}
});
} else {
Log.e(TAG, "twilioSdkInited obtainCapabilityToken");
obtainCapabilityToken(clientName, allowOutgoing, allowIncoming);
}
以下日志是重新启动我的应用程序时生成的错误。
07-06 10:10:14.265 32611-32611/com.reach.communications E/NewCallScreenActivity: @call onLoginStarted
07-06 10:10:14.265 32611-32611/com.reach.communications I/PJSIP: 10:10:14.265 sip_endpoint.c !Module "mod-pjsua-log" unregistered
07-06 10:10:14.265 32611-32611/com.reach.communications I/PJSIP: 10:10:14.265 sip_endpoint.c Module "mod-pjsua-log" registered
07-06 10:10:14.265 32611-32611/com.reach.communications E/BasicPhone: onInitialized onError :java.lang.RuntimeException: Twilio.initialize() already called
07-06 10:10:14.265 32611-32611/com.reach.communications E/BasicPhone: onInitialized onError : isTokenExpired is Blank
07-06 10:10:14.265 32611-32611/com.reach.communications E/NewCallScreenActivity: @call onLoginError :java.lang.RuntimeException: Twilio.initialize() already called
07-06 10:10:14.265 32611-32611/com.reach.communications E/NewCallScreenActivity: @Call State idle
如果我收到此错误并重新登录客户端如何处理。或如何重新初始化 twilio。
onError(异常错误)
提前致谢