NFC. Rozpocznij aktywność podczas skanowania wiadomości NDEF

Próbuję rozpocząć działanie, gdy mój smartfon skanuje wiadomość NDEF. To jest mój manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.androidbeam"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="17" />

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

    <uses-feature android:name="android.hardware.nfc" />

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

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="com.example.androidbeam.SendTextActivity" >

        </activity>
        <activity android:name="com.example.androidbeam.ReceiverNDEFActivity" >
            <intent-filter>
                <action android:name="android.nfc.action.NDEF_DISCOVERED" />
                <category android:name="android.intent.category.DEFAULT" />
                <data
                    android:host="ext"
                    android:pathPrefix="/com.example:externalType"
                    android:scheme="vnd.android.nfc" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Za każdym razem, gdy skanuję moją wiadomość NDEF, uruchamia się moja główna aktywność, ale chciałbym, aby moja funkcja ReceiverNDEFAct uruchomiła się. Nie wiem, dlaczego tak jest.

Oto moja wiadomość NdefMessage:

@Override
public NdefMessage createNdefMessage(NfcEvent event) {
    byte[] payload= new String("Hello");
    String domain = "com.example";
    String type = "externalType"; 
    NdefRecord extRecord = NdefRecord.createExternal(domain, type, payload);

    NdefMessage msg = new NdefMessage(new NdefRecord[] { extRecord });
    return msg;
}

questionAnswers(2)

yourAnswerToTheQuestion