Я пытался получать уведомление от PushBots на приложении навигации векселедателя MainActivity
и нескольких фрагментов .... Я написал этот код в HomeFragment
исключение IntentService GCMIntent обслуживание при использовании панели навигации приложения
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_home, container,
false);
diviceReg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Pushbots.sharedInstance().init(getActivity());
}
});
}
и вот мой файл манифеста
<!-- GCM connects to Google Services. -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission android:name="info.androidhive.slidingmenu.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="info.androidhive.slidingmenu.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive dataf message. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="info.androidhive.slidingmenu.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="info.androidhive.slidingmenu.MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name="com.pushbots.google.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="info.androidhive.slidingmenu" />
</intent-filter>
</receiver>
<receiver android:name="com.pushbots.push.DefaultPushHandler" />
<service android:name="com.pushbots.push.GCMIntentService" />
</application>
Я успешно зарегистрировать свое устройство на PushBots
... НО когда я отправить уведомление, приложение останавливается и имеет следующую ошибку:
05-21 12:14:07.613: E/AndroidRuntime(12087): FATAL EXCEPTION: IntentService[GCMIntentService-1037294394366-1]
05-21 12:14:07.613: E/AndroidRuntime(12087): java.lang.NoClassDefFoundError: android.support.v4.app.NotificationManagerCompat
Что случилось?
Ваше имя на упаковке? –
"info.androidhive.slidingmenu" –
Тогда что такое "com.pushbots.push"? –