When it's in a multi-window mode, force stopping an app will lead to an activity recreate, and the dialog fragment will also be recreated. That's why the dialog still shows after the button is clicked. Hence, dismiss the dialog before stopping the app to fix it. Fixes: 231529730 Test: robotest Change-Id: I75d27624f0c60bb617e7d1a92ffe01d3c0fbf7be