How programmatically send app to background

RomansUP

Member
Licensed User
Longtime User
Hi, I just want to ask question, How programmatically send my app to background mode.
Look what I mean:
I run several applications for example: InetBrowser, NotePad and mine app. The last app is mine. So mine app is in foreground mode, all other in background. If I finished mine app the NotePad will be in Foreground mode.
But I don' t want to closed (finished) mine app. I want to pause it and send to background after InetBrowser. Also I don't need simulate HOME button press, because HOME button will show HomeScreen without opened applications in foreground mode.

Thanks
 

RomansUP

Member
Licensed User
Longtime User
You know. I have wrote app with two activities. Second one is transparent. From first activity user runs browser. Then program runs second activity in foreground mode. So user still sees browser through second trasparent activity. It's looks like a sandwich ( first activity of my app - browser - second activity of my app). .After some code runs second activity goes finished. But after this first activity comes in to foreground mode infront of browser. So this is a problem how to keep first activity still under browser in background mode after second activity is finished?
Thanks
 
Last edited:
Upvote 0

RomansUP

Member
Licensed User
Longtime User
Yes transparent activity starting when browser is in foreground. I can't use WebView because my app must not use any Internet connections from it self. Browser is program - users choice. It can be any browser which was installed on device. Transparent activity starting after user press notification. In app I am using "Advance Notification" library. May be try to get info from system what browser user running and after transparent activity finished starting particular the same browser?
 
Last edited:
Upvote 0

RomansUP

Member
Licensed User
Longtime User
Well I call transparent activity from notification. I am using "advance notification" library. Probably it looks like a service, because notification still can calling second transparent activity when main activity is finished. You know I think I have found the answer for my question. I have made listing of all running apps on device in time when transparent activity is active. Then I get from list the app which is locating before mine. It's name I put in global verible of main activity. Then finished transparent activity. Android calls main activity resume sub. In resume sub a starting browser again if global veribls is not empty. To prevent of appiering of main activity before browser come up from pause mode I also making main activity transparent with no visible panels for a wile
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…