我正在尝试从PJSIP-Calls的监听器中切换活动,
但是收到此错误:Fatal signal 6 (SIGABRT), code -6 in tid 8613 (Thread-23469)
。
我的听众代码:
public void onIncomingCall(OnIncomingCallParam iprm){
Log.e("SIP_Account", "Receiving Call" );
SIP_Controler sip_controler = SIP_Controler.getInstance();
SIP_Call call = new SIP_Call(sip_controler.getSIPAccount(), sip_controler.getEndpoint());
if(sip_controler.hasActiveCall() ){
//If there is an active call, decline the incomming call and send busy signal
CallOpParam callOpParam = new CallOpParam();
callOpParam.setStatusCode(pjsip_status_code.PJSIP_SC_DECLINE);
try {
call.hangup(callOpParam);
} catch (Exception e) {
Log.e("SIP_Account", "Error while hanging up the incomming call " + e.toString());
}
}else{
Log.e("SIP_Account", "Try to change activity:" );
MiscFunctions.getCurrentForegroundActivity().changeActivity(VoIPViewCommands.RECEIVECALL, ActivityVoIPCall.class);
}
}
在MiscFunctions中,我得到了一个代码,允许我访问当前位于前台的Activity:
public class MiscFunctions {
static private TelephoneActivity currentForegroundActivity;
static public TelephoneActivity getCurrentForegroundActivity(){
return currentForegroundActivity;
}
static public void setCurrentForegroundActivity(TelephoneActivity ta){
currentForegroundActivity = ta;
}
...
而TelephoneActivity是SherlockFragmentActivity的延伸。
/***************************************************************************************************
* All activities in this project should extend this activity. This one will make sure that you can
* always get the activity that is currently in the foreground of your app.
*
**************************************************************************************************/
public class TelephoneActivity extends SherlockFragmentActivity {
public void onResume(){
super.onResume();
MiscFunctions.setCurrentForegroundActivity(this);
}
public void changeActivity(VoIPViewCommands extra, Class activityClass){
Intent i = new Intent(getApplicationContext() , activityClass);
Log.e("TelephoneActivity", "Change the activity" );
i.putExtra("Command", extra);
getApplicationContext().startActivity(i); //this is the line that leads to a crash
//with 'Fatal signal 6 (SIGABRT), code -6 in tid 8613 (Thread-23469)' message.
}
}
有谁可以向我解释这里有什么问题?