Plot Projects - MyNotificationOpenReceiver.class没有被触发,为什么?

时间:2017-10-06 11:11:43

标签: android android-broadcastreceiver geofencing

的Android

- 绘图的初始化成功完成,纬度和经度也会在调试日志中打印出来。

- 但是在Android 5.1 +中没有触发MyNotificationOpenReceiver。

在清单中:

<receiver android:exported="false" android:name=".MyNotificationOpenReceiver"> <intent-filter> <action android:name="com.activationmobileapp.ready2ride.plot.OpenNotification" /> </intent-filter> </receiver>

接收者类

public class MyNotificationOpenReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {

    FilterableNotification notification = intent.getParcelableExtra("notification");
    if (notification.getData() == null)
        return;

    Intent openIntent = new Intent(context, MainActivity.class);
    openIntent.setAction("com.activationmobileapp.ready2ride.plot.OpenNotification");
    openIntent.putExtras(intent.getExtras());
    openIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
    Log.e("debug", "onReceive: " );
    context.startActivity(openIntent);
}
}

主要活动:

 Plot.init(this);

的gradle:

 compile 'com.plotprojects:plot-android:2.3.0-beta'

0 个答案:

没有答案