我发展我的Android应用程序推送通知。在这一点上:ActivityNotFoundException在谷歌云端通讯
if (checkPlayServices()){
Intent intent = new Intent(this, RegistrationIntentService.class);
startActivity(intent);
}
设备必须进行注册以获得令牌,并将其发送到服务器,但是当我试图启动活动的代码崩溃。下面是在logcat中所示的错误:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cgp.tpvtablet/com.cgp.tpvtablet.activity.MainActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.cgp.tpvtablet/com.cgp.tpvtablet.area_push.notification.RegistrationIntentService}; have you declared this activity in your AndroidManifest.xml?
清单中的RegistrationIntentService声明为在其目前的包装服务:
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:windowSoftInputMode="adjustPan">
<activity
android:name=".activity.MainActivity"
android:label="@string/app_name"
android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.cgp.tpvtablet"/>
</intent-filter>
</receiver>
<service android:name=".area_push.notification.MyGCMListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service android:name=".area_push.notification.MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<service android:name=".area_push.notification.RegistrationIntentService"
android:exported="false"/>
</application>
编辑建议我这条道路时,我在写RegistrationIntentService表现。 任何人都可以帮助我吗?提前致谢。
包是:com.nvp.testapp – Viherbar