how can i close all activities and restart the app from the beginning when it goes on pause ?
for example when i press the home button it goes to on pause mode and when i launch it again it starts from the last activity i want to close all activities on onPause method so how can i do that ?

MainActivity / SettingActivity / SampleActivity 

i want to close all of them and again restart the app from the MainActivity 
and i want to start from onCreate method not just go to the MainActivity