我不能让我投入意向的群众演员,我把在A" addProximityAlert" [英] I can't get the extras that I put into an intent, that I put in a "addProximityAlert"

查看:176
本文介绍了我不能让我投入意向的群众演员,我把在A" addProximityAlert"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能让我投入意向的群众演员,我把一个addProximityAlert

  locationNotific.putExtra(名,地​​平线);

   // sendBroadcast(locationNotific); (我可以得到额外)

    PendingIntent lPendingIntent = PendingIntent.getBroadcast(此,0,locationNotific,0);

       IntentFilter的过滤器=新的IntentFilter(SendProximityIntent);

       registerReceiver(新ProximityIntentReceiver(),过滤器);


    lm.addProximityAlert((双)locationAlertGeoP.getLatitudeE6(),(双)locationAlertGeoP.getLongitudeE6(),(浮动)999999999,(长)100000,lPendingIntent);
 

在BroadcastReceiver的:

 公共无效的onReceive(上下文的背景下,意图意图){


    IDForNotificationString = intent.getStringExtra(姓名);
    //MA.notification(IDForNotificationString);
 

解决方案

尝试使用 FLAG_UPDATE_CURRENT getBroadcast()打电话,在你的临时演员与任何人在任何previous合并 PendingIntent 此相同的核心意图

I can't get the extras that I put into an intent, that I put in a "addProximityAlert"

locationNotific.putExtra("name", "ofek");

   // sendBroadcast(locationNotific); (I can get the extras)

    PendingIntent lPendingIntent = PendingIntent.getBroadcast(this, 0, locationNotific, 0);

       IntentFilter filter = new IntentFilter("SendProximityIntent"); 

       registerReceiver(new ProximityIntentReceiver(), filter);


    lm.addProximityAlert((double) locationAlertGeoP.getLatitudeE6(),(double) locationAlertGeoP.getLongitudeE6(), (float) 999999999,(long) 100000,lPendingIntent);

The BroadcastReceiver:

public void onReceive(Context context, Intent intent) {


    IDForNotificationString = intent.getStringExtra("name");
    //MA.notification(IDForNotificationString);

解决方案

Try using FLAG_UPDATE_CURRENT in your getBroadcast() call, to merge in your extras with any that were in any previous PendingIntent for this same core Intent.

这篇关于我不能让我投入意向的群众演员,我把在A" addProximityAlert"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆