foreground

Changing the Foreground colour of a contentpresenter in a listbox

两盒软妹~` 提交于 2019-11-29 16:38:21
问题 I have created the following style for a listbox that will have an image displayed next to some text: <Style x:Key="ImageListBoxStyle" TargetType="{x:Type ListBox}"> <Setter Property="SnapsToDevicePixels" Value="true"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.CanContentScroll" Value="True"/> <Setter

Applescript - Bring window to foreground

拈花ヽ惹草 提交于 2019-11-29 09:27:02
问题 I have an application with several windows opened at the same time. I'd like to bring a specific window to foreground (I know its title). At the moment I'm using a combination of keys to achieve this task but I'd like to try something different since I'm experiencing some problems with this approach. tell application "System Events" set frontmost of process "appIT" to true keystroke "1" using command down delay 0.2 end tell 回答1: If your application is scriptable and allows setting the index

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

早过忘川 提交于 2019-11-29 03:47:59
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 parameter is always false in BroadcastReceiver, but true in activites. Can anyone tell me which is the

How keep NSTimer when application entering background?

冷暖自知 提交于 2019-11-28 23:53:08
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(sendBatteryToServer:) userInfo:nil repeats: YES]; myTimer3 = [NSTimer scheduledTimerWithTimeInterval: 5.0

Android Notification restarts app but want to resume

倾然丶 夕夏残阳落幕 提交于 2019-11-28 21:24:29
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 behaviour I want. Any ideas ? String ns = Context.NOTIFICATION_SERVICE; NotificationManager

How to be notified when foreground (top) activity (application) changes

时光总嘲笑我的痴心妄想 提交于 2019-11-28 19:23:57
I want to write a service for Android platform that is notified when the current foreground activity changes. Basically the service should do some tasks only when the top activity changes. Is there any way to subscribe and to be notified when this kind of event occurs ? Or there is no possibility and the service should poll from time to time the list of running activities and to check what is the foreground activity ?Not preferable solution... Kevin AFAIK there are two ways to do that. Start a service and monitor the Activity Stack, you might check it here Use an Accessibility Service, you

Is there a foreground equivalent to background-image in css?

半腔热情 提交于 2019-11-28 18:33:46
I want to add some shine to an element on webpage. I would prefer if I don't have to add additional html to the page. I want the image to appear in front of the element rather than behind. What's the best way to do this? To achieve a "foreground image" without extra HTML code, you can use a pseudo-element ( ::before / :before ) plus the CSS pointer-events . The last property is needed so that the user can actually click through the layer "as if it did not exists". Here's an example (using a color whose alpha channel is 50% so that you can see that the real elements can actually be focused):

How do I update the notification text for a foreground service in Android?

强颜欢笑 提交于 2019-11-28 15:36:51
I have a foreground service setup in Android. I would like to update the notification text. I am creating the service as shown below. How can I update the notification text that is setup within this foreground service? What is the best practise for updating the notification? Any sample code would be appreciated. public class NotificationService extends Service { private static final int ONGOING_NOTIFICATION = 1; private Notification notification; @Override public void onCreate() { super.onCreate(); this.notification = new Notification(R.drawable.statusbar, getText(R.string.app_name), System

Bring to forward window when minimized

我的梦境 提交于 2019-11-28 12:22:54
I want to know how to bring forward a particular window. SetForegroundWindow works when the window is not minimized!! but when a minimize the window, SetForegroundWindow doesn't work... this my code: int IdRemoto = int.Parse(textBoxID.Text); Process[] processlist = Process.GetProcessesByName("AA_v3.3"); foreach (Process process in processlist) { if (!String.IsNullOrEmpty(process.MainWindowTitle)) { if (IdRemoto.ToString() == process.MainWindowTitle) SetForegroundWindow(process.MainWindowHandle); } } [DllImport("user32.dll")] private static extern bool SetForegroundWindow(IntPtr hWnd); You can

START_STICKY, foreground Android service goes away without notice

岁酱吖の 提交于 2019-11-28 10:16:20
I have started a service in my new application. The service is foregrounded, with a Notification. When this is run in the AVD 2.1 API Level 7, all works fine. But when it's run on a Samsung Galaxy Tab running Gingerbread, the service will start (the icon and app name appear at the top of the notification area), but after a few seconds, the service disappears. The last entry in the Log that I can see is associated with my App, is the result of my Log.d("Taglines","Returning with " + START_STICKY), which immediately precedes "return START_STICKY ;" in my Service's onStartCommand override, as