foreground

Foreground Vs Active window

大城市里の小女人 提交于 2019-11-26 19:34:32
问题 In Windows, what is the difference between foreground and active window? To be specific, under what circumstances can a foreground window not be an active window? If the 2 terms are referring to the same concept why there're 2 terms. The msdn documentation here mentions "clicking a window, or by using the ALT + TAB or ALT + ESC key combination" makes a window active as well as foreground. There is nothing explicitly about the difference between the 2 terms.Check MSDN. 回答1: The active window

How to determine if an Android Service is running in the foreground?

折月煮酒 提交于 2019-11-26 10:58:39
问题 I have a service which I believe to have running in the foreground, How do I check if my implementation is working? 回答1: private boolean isServiceRunning(String serviceName){ boolean serviceRunning = false; ActivityManager am = (ActivityManager) this.getSystemService(ACTIVITY_SERVICE); List<ActivityManager.RunningServiceInfo> l = am.getRunningServices(50); Iterator<ActivityManager.RunningServiceInfo> i = l.iterator(); while (i.hasNext()) { ActivityManager.RunningServiceInfo runningServiceInfo

How to startForeground() without showing notification?

两盒软妹~` 提交于 2019-11-26 10:15:49
I want to create a service and make it run in the foreground. Most example codes have notifications on it. But I don't want to show any notification. Is that possible? Can you give me some examples? Are there any alternatives? My app service is doing mediaplayer. How to make system not kill my service except the app kill it itself (like pausing or stopping the music by button). As a security feature of the Android platform, you cannot , under any circumstance, have a foregrounded service without also having a notification. This is because a foregrounded service consumes a heavier amount of

Foreground service being killed by Android

爷,独闯天下 提交于 2019-11-26 09:38:54
Update : I have not found a true solution to the problem. What I did come up with was a method of automatically reconnecting to a previous bluetooth device anytime the connection is lost. It's not ideal, but it seems to work fairly well. I'd love to hear any more suggestions regarding this though. I'm having much the same issue as in this question: Service being killed while holding wake lock and after calling startForeground including the device (Asus Transformer), the length of time before service is stopped (30-45 mins), the use of wake lock, the use of startForeground(), and the fact that

iOS: Keep an app running like a service

我怕爱的太早我们不能终老 提交于 2019-11-26 07:25:03
问题 In iOS, how would I instruct the OS to keep my app running even if it is no longer in the foreground? Skype Viber Empatica Zenly And many more apps does this. 回答1: Basically, there is no such thing as a service type app or functionality in iOS. Even the "background" apps (UIBackgroundMode) cannot run entirely free and without restrictions like a service or daemon etc. on other OSs can. Here's the situation regarding background execution and notifications and timers etc. 1) An app cannot

How to startForeground() without showing notification?

南楼画角 提交于 2019-11-26 02:06:04
问题 I want to create a service and make it run in the foreground. Most example codes have notifications on it. But I don\'t want to show any notification. Is that possible? Can you give me some examples? Are there any alternatives? My app service is doing mediaplayer. How to make system not kill my service except the app kill it itself (like pausing or stopping the music by button). 回答1: As a security feature of the Android platform, you cannot , under any circumstance, have a foregrounded

Context.startForegroundService() did not then call Service.startForeground()

喜欢而已 提交于 2019-11-26 01:42:11
问题 I am using Service Class on the Android O OS. I plan to use the Service in the background. The Android recommendation states that startService() should use startForegroundService() . If you use startForegroundService() , the Service throws Context.startForegroundService() did not then call Service.startForeground() error. What\'s wrong with this? 回答1: From Google's docs on Android 8.0 behavior changes: The system allows apps to call Context.startForegroundService() even while the app is in