Android Question Service activity

kepler

Active Member
Licensed User
Longtime User
Good day,

I'm doing a project where while the application is running the user can call a web browser window (which opens).

My question is: do I set that browser call in a service module, and the main activity will keep running? Or must I call it - overriding the main - and deal with the background main routines in the service module...?

I don't know very well the process of running a background activity - in this case Main must be all ways running, The browser is just a call.

Kind regards,

Kepler
 

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,
Good question (which implies you didn't already got the process life cycle). Each time an activity is in the background, it is paused. This means that : if your browser is launched, your activity will be in the background and will be... .... .... paused (yes, you're right).
So if you have something to display from the web, perhaps it could be :
- or keeping your activity in the foreground and display the web in an embeded webview
- or keeping the opening of the separated browser's app but you would have to do some tasks in the background using a service

As Main must be all ways running, you should go with an embeded webview
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…