Android Question Start the activity while the app in background

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi all.

My app consumes a webservice and I'm using HTTPJob in foreground service.

Based on the results given by this webservice I need to start different activities.

For example if user's account has problems - start activity ProviderProblems, if all is Ok - start activity SelectClient. It works fine even if the user clicked the Home button and the app goes into background. It doesn't interrupt the sync. But if the app in the background the new activity doesn't start.

I tried to use StartActiity - no errors, just nothing.
I tried to use CallSubDelayed("actiivityname","procname") - no errors, no exceptions, activity doesn't start and in the log I see a message "sending message to waiting queue of uninitialized activity (donothing)" where donothing is just a procedure name.

If the app in foreground all works fine.

So how to start the activity while the app in background?

The rule says

I expected that when the app becomes visible the activity will be called. It's doesn't.
 

Solutions Development

Member
Licensed User
Longtime User
Try this

this method allows you to have your app always in the foreground and so you can open other Activities even when it doesn't seem visible.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…