Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onTrimMemory is used only for API level 14 , I need to detect when app is backgrounded for api level <14 #1105

Closed
sabrinemoumni opened this issue Aug 20, 2015 · 2 comments
Labels
s/needs-more-info Needs more information from the reporter

Comments

@sabrinemoumni
Copy link

What can I do to detect when app is backgrounded like new relic
I should'nt use the life cycle of activity

@Cheesebaron Cheesebaron added the s/needs-more-info Needs more information from the reporter label Aug 20, 2015
@Cheesebaron
Copy link
Member

Why do you use OnTrimMemory to detect whether an app is in the background? That is not pretty at all. You could have a service which detects if the app is in the background like in this kiosk mode sample: https://github.com/Cheesebaron/KioskModeSample/blob/master/KioskMode/KioskService.cs#L59

Otherwise use OnStop and OnStart on your Activity to track whether it is in the background or not.

To be honest, this is not a MvvmCross specific question, but rather a general Android question. Please use StackOverflow for this. We try to keep GitHub issues for actual MvvmCross issues.

@sabrinemoumni
Copy link
Author

ok I test this method but I have a fear , I wonder if it needs more resources of cpu and memory cause I will get all running task every second for exemple ?
concerning the life cyle, I can't intercept these methods
I use java android

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s/needs-more-info Needs more information from the reporter
Development

No branches or pull requests

2 participants