简体   繁体   中英

“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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM