single-instance

Cancel ALL Animation on SingleInstance

拜拜、爱过 提交于 2019-12-23 16:41:17
问题 I am wondering if its at all possible to cancel ALL animation when starting an singleInstance activity, i am already using @Override public void onStop() { super.onStop(); overridePendingTransition(0, 0); } @Override public void onResume() { super.onResume(); overridePendingTransition(0, 0); } for when finish is called and intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); to activate it... but theres still a black screen ( short loading one). trying creating a costume Theme and didnt cancel

Cancel ALL Animation on SingleInstance

微笑、不失礼 提交于 2019-12-23 16:39:11
问题 I am wondering if its at all possible to cancel ALL animation when starting an singleInstance activity, i am already using @Override public void onStop() { super.onStop(); overridePendingTransition(0, 0); } @Override public void onResume() { super.onResume(); overridePendingTransition(0, 0); } for when finish is called and intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); to activate it... but theres still a black screen ( short loading one). trying creating a costume Theme and didnt cancel

Allow only one application instance

烈酒焚心 提交于 2019-12-23 08:55:13
问题 I'm sorry about my title may be it make you confusing (it's just I don't know what words should I use). My problem is I don't want to allow user to open my application multiple time. Please help. Thank you in advance. 回答1: Use the “Make single instance application” flag; in the solution explorer, right-click the project and select properties. See this question for more details. MSDN documentation here. Screenshot: 回答2: Use the “Make single instance application” flag; in the solution explorer

Custom animation doesnt work on SingleInstance Activity

瘦欲@ 提交于 2019-12-23 03:18:30
问题 Im trying to change the default animation of activities transitions, and i stuck with a problem. I could change the animation of normal activities, but when i change the launchMode to singleInstance, the first time i open the activity, the animation come with Default. Then, every time i call it again, it come with the right custom animation. I tried with window.attributes.windowAnimations, with just style/theme and also overridePendingTransition() and the result is always the same. I saw some

Java single instance software with socket. issue in closing socket under windows

自作多情 提交于 2019-12-21 05:36:16
问题 I need to force my Java application to run with a single instance. I found on this link this very nice piece of code that solve the problem using socket instead of using the file system. here the as i adjusted: package cern.ieplc.controller; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; import java.net.UnknownHostException; import org.apache.log4j.Logger; import java.io.BufferedReader; import java.io.IOException; import

single instance and notify in system tray

◇◆丶佛笑我妖孽 提交于 2019-12-18 17:31:20
问题 I am working on the application (C# 2.0). I have implemented single instance in it. Everything is fine. If i run the application again, it shows messagebox saying "instance is already running". Actually i don't want to show the message through messagebox. I want to show this message using Balloon tip of already running instance (it has notify icon in system tray). How can i achieve this? Thanks in advance. 回答1: You need a form of interprocess communication, to signal to the other instance

Restrict multiple instances of an application in java

隐身守侯 提交于 2019-12-17 13:59:12
问题 I want to prevent multiple instances of application being launched in java. I know 2 methods for this: locking file locking socket But which is one is more efficient and good to use? Which one should I use? Any other solution to do the same are also welcome. 回答1: EDIT: I tried that with Win200864b(version isn't important) and alive JFrame and move toFront() or Iconified in SystemTray with JFrame.DO_NOTHING_ON_CLOSE public interface ApplicationStartedListener { void applicationStarted(); void

How to create a single instance application in C or C++

僤鯓⒐⒋嵵緔 提交于 2019-12-17 03:54:42
问题 What would be your suggestion in order to create a single instance application, so that only one process is allowed to run at a time? File lock, mutex or what? 回答1: A good way is: #include <sys/file.h> #include <errno.h> int pid_file = open("/var/run/whatever.pid", O_CREAT | O_RDWR, 0666); int rc = flock(pid_file, LOCK_EX | LOCK_NB); if(rc) { if(EWOULDBLOCK == errno) ; // another instance is running } else { // this is the first instance } Note that locking allows you to ignore stale pid

How to create a single instance application in C or C++

两盒软妹~` 提交于 2019-12-17 03:54:08
问题 What would be your suggestion in order to create a single instance application, so that only one process is allowed to run at a time? File lock, mutex or what? 回答1: A good way is: #include <sys/file.h> #include <errno.h> int pid_file = open("/var/run/whatever.pid", O_CREAT | O_RDWR, 0666); int rc = flock(pid_file, LOCK_EX | LOCK_NB); if(rc) { if(EWOULDBLOCK == errno) ; // another instance is running } else { // this is the first instance } Note that locking allows you to ignore stale pid

Android one MediaPlayer instance - singleton

自闭症网瘾萝莉.ら 提交于 2019-12-13 13:15:03
问题 I am about to create simple android app to play sound on a button click but I struggle with understanding singleton design pattern which would be very helpful in this application. What I try to achieve is to have number of activities and share only one MediaPlayer instance among them so that wehen user presses the button sound plays and if he will press the same or another button on same or different activity the sound will stop. Here is my code but after pressing the button twice another