Foreground/Background Android App

Asked

Viewed 2,051 times

0

Good morning, you guys! I’m new in android, I need to check if the application is in the foreground or background, if it is in the background it needs to go back to foreground and if the user finalizes the application it reopens.

I count on your help

  • Don’t you think putting that kind of behavior into an app feels a little bit imperative? It seems that you want the app to be open anyway, whether you want the user or not, this can make the user dislike your app. Not to mention that, by configs, there is no way to prevent an app from being closed.

  • i know! but user asked this! rsrs, it’s not something I thought to do on my own not

  • Oh yes, but I already told you, if a user is in the options of the application, and "force stop", there is nothing you can do.

  • @Diegodiasmól and Outra, the control of applications who does is the operating system itself, if you want to let something run all the time, create a service for it.

  • that’s it! I thought to create some way to lock (password or no password even) the opening of another application that is not what the user wants

  • There is user control on android. What you seem to want to do is a system of access and permissions. Maybe it is not feasible to do this, since this whole control may require root access.

  • doing root, I could leave only my app, being triggered when connecting the device

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.