mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
fix #14, properly handle View intent by the dialpad
This commit is contained in:
@ -93,6 +93,16 @@
|
|||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<action android:name="android.intent.action.DIAL" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data android:scheme="tel" />
|
||||||
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
|
@ -107,7 +107,7 @@ class DialpadActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun checkDialIntent(): Boolean {
|
private fun checkDialIntent(): Boolean {
|
||||||
return if (intent.action == Intent.ACTION_DIAL && intent.data != null && intent.dataString?.contains("tel:") == true) {
|
return if ((intent.action == Intent.ACTION_DIAL || intent.action == Intent.ACTION_VIEW) && intent.data != null && intent.dataString?.contains("tel:") == true) {
|
||||||
val number = Uri.decode(intent.dataString).substringAfter("tel:")
|
val number = Uri.decode(intent.dataString).substringAfter("tel:")
|
||||||
dialpad_input.setText(number)
|
dialpad_input.setText(number)
|
||||||
dialpad_input.setSelection(number.length)
|
dialpad_input.setSelection(number.length)
|
||||||
|
Reference in New Issue
Block a user