Search code examples
androidandroid-intentintentfilter

"Complete action using" to send SMS not showing my app in android


I know this question is asked many times and I have tried all the solutions also. But still my app is not shown in the "Complete action using" list.

My myapp.manifest code:

    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.CALL_PHONE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.contactmanager.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />

                <intent-filter>
                    <action android:name="android.intent.action.VIEW" />
                    <action android:name="android.intent.action.SENDTO" />
                    <action android:name="android.intent.action.SEND" />

                    <category android:name="android.intent.category.DEFAULT" />
                    <category android:name="android.intent.category.BROWSABLE" />

                    <data android:scheme="sms" />
                    <data android:scheme="smsto" />
                </intent-filter>
            </intent-filter>
        </activity>
    </application>

I have set permissions also but still i am missing something.May I need to restart my cell after installing this app?Or any settings i need to change?.Kindly help me to figure out the problem.


Solution

  • You have an <intent-filter> in your <intent-filter>, which isn't correct. Instead, you should have two <intent-filter> entries - one for the launcher intent and another for SMS sending:

    <activity
            android:name="com.example.contactmanager.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SENDTO" />
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
    
                <data android:scheme="sms" />
                <data android:scheme="smsto" />
            </intent-filter>
        </activity>