Is there a way to check if my app is open or in background

Hi Koders, I have made an app in Kodular in which I want to check if my app in currently opened or is in background. Is there a way to do this or any extension

When the app is in the background, there is no way to indicate whether the app is open or not, as the app is not visible. When the app is open, the question of whether it is open is obsolete.

So what’s the point of this question? What is intended.
And what exactly is meant by background here? Is the app just not visible or has it been closed.

1 Like

Background means that the app is opened but in recent apps. You may see the feature in many android phones.

By the way, @bodymindpower, thank you very much for taking interest in the topic.

image

I think these blocks might be of some help to you.

2 Likes

Very much thank you @AtharvaPawar

1 Like

Your topic / question:
“Is there a way to check if my app is open or in background”
Answer: Yes, you can just see it.

The topic or question should have been:
“How can I know if or when my app changes from one lifecycle to another?”

https://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle

3 Likes

I meant that if my app is killed or is opened.

No, if the app is killed (closed), the .OnAppResume event will not be triggered, only after pressing the device Home button or after executing a MoveToBackground method (which some extensions provide).

For more details see here:

2 Likes

Very Happy with Kodular Community for very fast and reliable replies by people.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.