foreground

startForeground() does not show my Notification

耗尽温柔 提交于 2019-11-28 07:08:56
I am trying to make my Service running in foreground. I tried to use this example (please look for the section " Running a Service in the Foreground "), but startForeground() does not actually show my notification. And no exceptions is thrown. To make it shown, I need to use NotificationManager like here explained. With NotificationManager my notification works, but i'm not sure that my Service is foreground after this "silent" call to startForeground() . What can be wrong? EDIT : I just tested this sample project that should demonstrate startForeground() , but it does not work! I use API v7.0

iOS NSNotificationCenter to check whether the app came from background to foreground

最后都变了- 提交于 2019-11-28 01:49:00
I have a situation in which i have to intialize an object everytime when it comes from background to foreground and that should be using the NSNotificationCenter not with appdelegate because iam building a static library so there wont be appdelegate with that so please help me in the same. Have you tried UIApplicationWillEnterForegroundNotification ? The app also posts a UIApplicationWillEnterForegroundNotification notification shortly before calling applicationWillEnterForeground: to give interested objects a chance to respond to the transition. Subscribe to notification: [

Can I launch an app in Foreground when I enter an iBeacon range?

…衆ロ難τιáo~ 提交于 2019-11-28 01:46:37
I'm creating an app for iOS using iBeacons. I know, that if i set up a region to monitor, the framework can invoke my app when I enter/exit a region, or turn on the screen inside the region. I've managed to create a local notification in this callback as well. My question is, whether is it possible to bring the app into foreground, like if it was launched by the user? No, I do not believe this is possible. Apple's philosophy is that the user is in control of what app is in the foreground. The only three ways to bring an app into the foreground are: (1) tapping its icon, (2) tapping a

Oreo - Starting a service in the foreground

旧时模样 提交于 2019-11-28 00:24:55
问题 I have created a service that tracks the device's location as it moves. The service is started in by an Activity that binds to it, and in this activity there is a "Start Tracking" button. When this button is pressed, I need the service to start in the foreground, so that it stores the Locations that the device has moved to, even if the Activity that binds to it is closed, or the app is minimised. I understand that for the Service to be in the foreground, a notification must be displayed. I

How do I get tcsetpgrp() to work in C?

安稳与你 提交于 2019-11-27 22:58:31
I'm trying to give a child process (via fork() ) foreground access to the terminal. After I fork() , I run the following code in the child process: setpgid(0, 0); And: setpgid(child, child); In the parent process. This gives the child its own process group. The call to setpgid() works correctly. Now I want to give the child access to the terminal. I added the following to the child after the setpgid() call: if (!tcsetpgrp(STDIN_FILENO, getpid())) { perror("tcsetpgrp failed"); } After that, there is an execv() command to spawn /usr/bin/nano . However, instead of having nano come up, nothing

Bring window to front -> raise(),show(),activateWindow() don’t work

◇◆丶佛笑我妖孽 提交于 2019-11-27 22:47:59
In my Qt-application I open a URL in the default-browser. Afterwards I want to bring the main-window of my application to the front again. I tried all approaches I could find but none worked. All it does is blink in the taskbar (of Window 7) Here’s an example: this->viewer->show(); this->viewer->raise(); this->viewer->activateWindow(); *viewer is a pointer to a QmlApplicationViewer which is derived from QDeclarativeView Johan Råde This problem is specific to Windows. If the active window belongs to some process, then Windows does not allow other processes to change the active Window. (Do not

Android Notification restarts app but want to resume

谁说胖子不能爱 提交于 2019-11-27 20:55:09
问题 Hi I have a been able to get a notification displayed for my activity, and when the user clicks the notification the app restarts. However I just want it to reappear not restart. eg. it is a web app and I want it to come to the front when the user selects the notification..but not refresh the web page. Can I trap this intent or am I sending the wrong intent? Normally if I press the home button and click on the app icon the app comes to the fore and doesn't refresh/restart. So this is the

Foreground Vs Active window

大憨熊 提交于 2019-11-27 18:44:07
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 . The active window (the result of GetActiveWindow() ) is the window attached to the calling thread that gets input. The

How to know in BroadcastReceiver if App is running on foreground?

空扰寡人 提交于 2019-11-27 17:57:29
问题 I am working in application that needs make a synchronization every night. I use Alarm Manager that calls a BroadcastReceiver at the hour that I want. The problem is that I cant make a synchronization if the application is running in foreground to avoid losing data. So I need to know in Broadcast Receiver if the app is running in foreground to cancel this synchronization. I tried solutions that I found in StackOverflow: Checking if an Android application is running in the background But this

How keep NSTimer when application entering background?

谁都会走 提交于 2019-11-27 15:09:13
问题 I'm here because a didn't find any solutions for my issue :( I'm doing an simple application in which i have to send (by socket) some informations to a server (like GPS l/L, accuracy, Battery level, etc). The current code works fine when application is in foreground. myTimer = [NSTimer scheduledTimerWithTimeInterval: 2.0 target:self selector: @selector(sendPosToServer:) userInfo:nil repeats: YES]; myTimer2 = [NSTimer scheduledTimerWithTimeInterval: 3.0 target:self selector: @selector