onNewIntent not called on restart
问题 I have an alarm clock app, that is using Alarm Manager and a Broadcast Receiver. The app is one single activity and 4 fragments. When an alarm goes off the onReceive method sends an intent to the main activity, the main activity receives this intent in the method onNewIntent and then moves to the correct fragment. Everything works fine, except when an alarm goes off after the app has been closed. Once I destroy the app, the alarm still goes off and the intent from the broadcast receiver fires