I am confused in how to trigger an event when the activity is changed. One thing that I know is using onWindowFocusChanged() method but I don’t know how to use it. Please help in one example i.e. when the activity changes, it should show a toast said “Activity changed”.
I am confused in how to trigger an event when the activity is changed.
Share
The following method gets called when window’s focus changes. For instance, if the window gains/losses focus, it will be triggered. In case, the window gains focus,
hasFocusis true and false otherwise.