I want to make a database request whenever the main activity is dislpayed on the screen , the main activity is the one defined in the manifest file :
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
if I start another activity by clicking a menu item for example , then when I finish it by pressing the back button or the code executes a finish
command then I want the database request to be launched because at this moment it is the main activity which is displayed. So how to know that the main activity is displayed ?