File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
Examples/restcomm-olympus/app/src/main
java/org/restcomm/android/olympus Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 4545 </intent-filter >
4646 <intent-filter >
4747 <action android : name =" android.intent.action.CALL" />
48-
48+ <action android : name =" android.intent.action.VIEW" />
49+ <action android : name =" android.intent.action.DIAL" />
4950 <category android : name =" android.intent.category.DEFAULT" />
5051 <category android : name =" android.intent.category.BROWSABLE" />
5152
Original file line number Diff line number Diff line change @@ -73,14 +73,16 @@ protected void onCreate(Bundle savedInstanceState)
7373 //boolean signedUp = prefsGeneral.getBoolean(PREFS_SIGNED_UP_KEY, false);
7474
7575 // see if we are called from an external App trying to make a call
76- if (getIntent ().getAction ().equals (Intent .ACTION_CALL ) && getIntent ().getData () != null ) {
77- if (getIntent ().getData () != null ) {
78- // note down the fact that we are signed up so that
79- //SharedPreferences.Editor prefEdit = prefsGeneral.edit();
80- //prefEdit.putString(PREFS_EXTERNAL_CALL_URI, getIntent().getData().getHost());
81- //prefEdit.apply();
82- globalPreferences .setExternalCallUri (getIntent ().getData ().toString ());
83- }
76+ // Notice that we also add the ACTION_VIEW, so that it also works for
77+ // numbers inside text that we tap on for example in default Android SMS App.
78+ // For the ACTION_VIEW, the number comes prepended with tel, like 'tel:XXXXXXXXX'
79+ if ((getIntent ().getAction ().equals (Intent .ACTION_CALL ) || getIntent ().getAction ().equals (Intent .ACTION_VIEW )) &&
80+ getIntent ().getData () != null ) {
81+ // note down the fact that we are signed up so that
82+ //SharedPreferences.Editor prefEdit = prefsGeneral.edit();
83+ //prefEdit.putString(PREFS_EXTERNAL_CALL_URI, getIntent().getData().getHost());
84+ //prefEdit.apply();
85+ globalPreferences .setExternalCallUri (getIntent ().getData ().toString ());
8486 }
8587
8688 if (globalPreferences .haveSignedUp ()) {
You can’t perform that action at this time.
0 commit comments