소스 검색

Calling `cancel` on Android with an invalid String as ID does not throw an error anymore.

Sebastián Katzer 12 년 전
부모
커밋
54575439f3
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      src/android/LocalNotification.java

+ 4 - 1
src/android/LocalNotification.java

@@ -138,7 +138,10 @@ public class LocalNotification extends CordovaPlugin {
         NotificationManager nc = getNotificationManager();
 
         am.cancel(pi);
-        nc.cancel(Integer.parseInt(notificationId));
+
+        try {
+            nc.cancel(Integer.parseInt(notificationId));
+        } catch (Exception e) {}
     }
 
     /**