Questions tagged [single-instance]

Make sure that only one instance of the application is running on the system.

250 questions
4
votes
2 answers

Android one MediaPlayer instance - singleton

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…
Lenny
  • 887
  • 1
  • 11
  • 32
4
votes
2 answers

Single instance of C++ program, using boost::interprocess

I have a console application which I am trying to make able to run just once at a time. I have used boost interprocess library shared_memory_object to do that. See the code snippet below, boost::scoped_ptr sharedMem; try …
serhatg
  • 312
  • 1
  • 3
  • 15
4
votes
1 answer

Cancel ALL Animation on SingleInstance

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()…
Jony-Y
  • 1,579
  • 1
  • 13
  • 30
4
votes
4 answers

Find running clickonce deployed single instance app?

I'm currently facing a problem with my single instance clickonce deployed app, and maybe someone has a good idea about it. My app is called by a web application, which passes parameters to this exe. Now the problem is, if the application is already…
Martin Moser
  • 570
  • 6
  • 12
4
votes
2 answers

java.lang.InstantiationException: can't instantiate class ... no empty constructor

I have found topics with similar questions like mine but cant find the answer I am looking for so far. my application consists of a FragmentActivity which hosts a ViewPagerAdapter (child of FragmentPagerAdapter) with a fragment in each tab. My…
Panos
  • 101
  • 1
  • 1
  • 4
4
votes
4 answers

How to run one instance of a c# WinForm application?

I've a C# application that displays a login form when launched and displays the main form after users are authenticated. I used Mutex to restrict that only one instance of my application runs. And, this works fine for only the Login form. Once the…
aby
  • 810
  • 6
  • 21
  • 36
4
votes
3 answers

Force single instance of TopShelf service

I'm using TopShelf to host my windows service. This is my setup code: static void Main(string[] args) { var host = HostFactory.New(x => { x.Service(s => { s.ConstructUsing(name => new MyService()); …
Toperz
  • 116
  • 7
3
votes
2 answers

How to prevent open my application more than one time?

Possible Duplicate: What is the correct way to create a single instance application? How can I define my application to open only one time after click on its exe file over and over?
user1269592
  • 691
  • 3
  • 12
  • 24
3
votes
2 answers

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

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…
Stefano
  • 3,981
  • 8
  • 36
  • 66
3
votes
0 answers

How to make sure that single instance of Java Web Start application is running on client's machine?

I am trying to execute .jnlp file on client machine using java web start as well as open web start. How to make sure that only single instance of jnlp application or java web start application is running on client's machine? I found that need to use…
3
votes
2 answers

Mutex initialization inside a C# method always returns positive createdNew

I have created simple MutexManager: public static class MutexManager { private static string mutexName { get { return "MyAppName" + System.Security.Principal.WindowsIdentity.GetCurrent().User.AccountDomainSid; …
Bartek Chyży
  • 521
  • 9
  • 25
3
votes
0 answers

How Android limit single app instance?

In simple Java application, if we open it 2 times, 2 app instances will be launched. AFAIK there are some ways to limit single instance for Java app such as: using FileLock to lock a RandomAccessFile & add shutdown hook to release it later when app…
nhoxbypass
  • 9,695
  • 11
  • 48
  • 71
3
votes
1 answer

Autofac with wcf

builder.Register(c => new ChannelFactory ("BasicHttpBinding_IBuildingInfoService")) .SingleInstance(); builder.Register(c => c .Resolve>().CreateChannel()) …
Abi
  • 283
  • 3
  • 16
3
votes
0 answers

single_process module works but getting different errors when using it

I have a program running and to be sure that it restarts in case it would crash, I have a cronjob, which tries to run it every few minutes, no matter if it already runs or not. For this I had to us the single_process module. The code is the…
sunwarr10r
  • 4,420
  • 8
  • 54
  • 109
3
votes
1 answer

Keep task stack when opening singleInstance activity from recent apps screen

My application contains multiple activities, the main activity (A) is in launchMode singleTop, every over activities are in singleInstance mode. I've choose singleInstance for preventing illimited navigation if i navigate like this : A -> B -> C ->…