Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isServiceRunning returning true even when it isn't #13

Open
Red-Folder opened this issue Feb 19, 2014 · 2 comments
Open

isServiceRunning returning true even when it isn't #13

Red-Folder opened this issue Feb 19, 2014 · 2 comments
Labels

Comments

@Red-Folder
Copy link
Owner

From Luigi;

Something strange in

    if (appClassName != null) {
        //if (AppHelper.isServiceRunning(context, appClassName)) {
        //    Log.d(TAG, appClassName + " already running");
        //} else {
            Log.d(TAG, appClassName + " starting");
            AppHelper.startActivity(context, appClassName);
        //}
    }

I had to comment out as per above because it was telling me the app was running.

Anyway it should not arm if it gets restarted even if already on (at least as long as manifest contains "singleistance".

The other positive effect is that it brings in foreground the app, which again is a wanted behaviour...

@Red-Folder Red-Folder added the bug label Feb 19, 2014
@Red-Folder
Copy link
Owner Author

http://developer.android.com/guide/topics/manifest/activity-element.html recommends against using singleInstance.

I'll have a look at the existing code so that it works to only allow once instance (maybe make that a configurable option). Assuming developer only wants a single instance:

If activity already running
   bring activity to front
else
   start activity

@luigi37
Copy link
Contributor

luigi37 commented Feb 20, 2015

Hi Marc, any chance to implement the bring to front activity?
For some reason the latest cordova (4.2.0) +android (3.6.4) does start multiple instances despite the directive "singleTask" so I'm back to trying "just" bringing to front the activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants