fix #38, properly handle the VIEW third party intent
This commit is contained in:
parent
8dd3fc561f
commit
4dcd17fe1f
|
@ -45,6 +45,7 @@
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.SEND" />
|
<action android:name="android.intent.action.SEND" />
|
||||||
<action android:name="android.intent.action.SENDTO" />
|
<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.DEFAULT" />
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
|
@ -95,9 +95,10 @@ class NewConversationActivity : SimpleActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isThirdPartyIntent(): Boolean {
|
private fun isThirdPartyIntent(): Boolean {
|
||||||
if (intent.action == Intent.ACTION_SENDTO && intent.dataString != null) {
|
if ((intent.action == Intent.ACTION_SENDTO || intent.action == Intent.ACTION_SEND || intent.action == Intent.ACTION_VIEW) && intent.dataString != null) {
|
||||||
val number = intent.dataString!!.removePrefix("sms:").removePrefix("smsto:").removePrefix("mms").removePrefix("mmsto:").trim()
|
val number = intent.dataString!!.removePrefix("sms:").removePrefix("smsto:").removePrefix("mms").removePrefix("mmsto:").trim()
|
||||||
launchThreadActivity(URLDecoder.decode(number), "")
|
launchThreadActivity(URLDecoder.decode(number), "")
|
||||||
|
finish()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue