Search code examples
androidintentfilter

Application not appearing in activity chooser whenever outgoing call is made using dailer


What intent filter should be used so that my app is shown in activity chooser whenever outgoing call is made :like Viber and Skype are shown.

I am using this filter:

   <receiver android:name="OutgoingCallReceiver" >
        <intent-filter>
            <action android:name="android.intent.action.ACTION_NEW_OUTGOING_CALL" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </receiver>

with permission:

<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />

still myApp do not appear in activity chooser.


Solution

  • Declare your Activity as to add it in option list for calling application

    <activity android:name="Makecall" >
        <intent-filter> 
            <action android:name="android.intent.action.CALL" />
            <data android:scheme="tel" />
            <category android:name="android.intent.category.DEFAULT" />
            <action android:name="android.intent.action.CALL_PRIVILEGED" />
        </intent-filter>
    </activity>
    

    and for calling to any Number use Intent.ACTION_DIAL as :

    Uri numberuri = Uri.parse("tel:"  + edit_text_number);
    Intent intent_call = new Intent(Intent.ACTION_DIAL, numberuri);
    startActivity(intent_call);