Skip to content

Commit 993a2a1

Browse files
author
f1xpl
authored
Merge pull request #1 from scorillo/master
Add support for calling from Contacts using sms URI
2 parents a823f1a + f523dd3 commit 993a2a1

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,17 @@
2121
android:theme="@android:style/Theme.Translucent.NoTitleBar">
2222
<intent-filter>
2323
<action android:name="android.intent.action.CALL" />
24+
<action android:name="android.intent.action.SEND" />
25+
<action android:name="android.intent.action.SENDTO" />
26+
2427
<category android:name="android.intent.category.DEFAULT" />
28+
<category android:name="android.intent.category.BROWSABLE" />
29+
2530
<data android:scheme="tel" />
31+
<data android:scheme="sms" />
32+
<data android:scheme="smsto" />
33+
<data android:scheme="mms" />
34+
<data android:scheme="mmsto" />
2635
</intent-filter>
2736
</activity>
2837
</application>

app/src/main/java/com/f1x/mtcdialer/DialActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public void onServiceConnected() {
3636
String extractPhoneNumber(Intent intent) {
3737
Uri uri = intent.getData();
3838

39-
if(uri != null && uri.getScheme().equals("tel")) {
40-
return uri.toString().replace("tel:", "").replaceAll("\\s+", "");
39+
if(uri != null && uri.getScheme().matches("tel|sms|smsto|mms|mmsto")) {
40+
return uri.getSchemeSpecificPart().replaceAll("\\s+", "");
4141
} else {
4242
return null;
4343
}

0 commit comments

Comments
 (0)