我正在做的是添加具有唯一ID的不同接近警报作为额外的并且它不起作用 -
for (int i = 0; i < latArray.size(); i++)
{
Bundle extra = new Bundle();
extra.putInt("UID", i);
Intent intent = new Intent(IntentToFire);
intent.putExtra("Blob", extra);
PendingIntent proximityIntent = PendingIntent.getBroadcast(this,-1 , intent, 0);
LocationManager locationManager =
Log.i("Picture:","Location img:"+GetLocation.imgArray.get(i));
Log.i("Potatoo:", "Lat :"+latArray.get(i)+" Lng :"+lngArray.get(i));
locationManager.addProximityAlert(Double.valueOf(latArray.get(i)), Double.valueOf(lngArray.get(i)), radius,expiration,proximityIntent);
}
然后在广播接收器上我把这段代码 -
flag = intent.getBundleExtra("blob").getInt("UID");
每次我要打印标志时,我都会收到一个错误。一个想法?