old代碼;java
<activity
android:name="com.vkoov.csipsimple.ui.OutgoingCallChooser"
android:configChanges="orientation"
android:launchMode="singleInstance"
android:theme="@style/CupcakeDialog" >
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter android:priority="-1" >
<action android:name="android.phone.extra.NEW_CALL_INTENT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
android
log:
app
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start receiver com.vkoov.csipsimple.service.OutgoingCall:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.CALL dat=csip:18682283082 flg=0x10000000 }
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2126)
at android.app.ActivityThread.access$1500(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1197)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4426)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.CALL dat=csip:18682283082 flg=0x10000000 }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1512)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1384)
at android.app.ContextImpl.startActivity(ContextImpl.java:852)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:276)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:276)
at com.vkoov.csipsimple.service.OutgoingCall.onReceive(Unknown Source)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2119)
... 10 moreoop
解決方法;ui
引發異常的緣由是沒有找到csipspa
須要在廣播裏面添加過濾器ip
正確代碼;it
<activity
android:name="com.vkoov.csipsimple.ui.OutgoingCallChooser"
android:configChanges="orientation"
android:launchMode="singleInstance"
android:theme="@style/CupcakeDialog" >
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="csip" />
<data android:scheme="sip" />
<data android:scheme="sips" />
</intent-filter>
<intent-filter android:priority="-1" >
<action android:name="android.phone.extra.NEW_CALL_INTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="csip" />
<data android:scheme="sip" />
<data android:scheme="sips" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SENDTO" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="csip" />
<data android:scheme="sip" />
<data android:scheme="sips" />
<data android:scheme="imto" />
</intent-filter>
</activity>io