I am creating a journal app, I want to apply an activity called "lock view" that will start once the app in the background being moved to foreground again, which is when user use that app again after using the other apps.
Can someone tell me how to do that? I have tried to start the lock activity in the onResume() method of main activity for this purpose but the lock activity load immediately after oncreate() method which is not what I am trying to achieve. I wanted to only start the lock activity when user return to the app(no matter which activity the user was previously at) from the background to the foreground.
I am not sure how to do it to an app that has quite a lot of activities to achieve this purpose. Would appreciate a lot if someone could help. Thank you in advance.