PendingIntent Bundle null解决方案

在安卓开发中,用通知栏,如果点击通知栏条目,跳转Intent需要传值的时候会出现问题,传入值失败。

Intent intent;  
PendingIntent sender=PendingIntent.getService(this, 0,   
intent=new Intent(this, PlacesProximityHandlerService.class), 0);  

intent.setAction("PlacesProximityHandlerService"); 
intent.putExtra("lat", objPlace.getLat()); 

  

需要给intent额外设置一个action动作,那样就不会出问题了。

原文地址:https://www.cnblogs.com/spring87/p/4983557.html