How to Handle Don't Keep Activities for Android Phone?

My Ionic App restarts whenever I switch to another app(like Camera, Gallery, while sharing etc). My question is how to handle situation when someone has enabled ‘Don’t Keep activites’