1. Download our Official Android App: Forums for Android!

Apps cannot bind service in android 5.0

Discussion in 'Android Development' started by py8765, Dec 11, 2014.

  1. py8765

    py8765 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Dec 11, 2014

    Dec 11, 2014
    1
    0
    5
    the first app exported a service, the second app cannot bind the service, and there is no error message.

    String serviceName = Constants.SERVICE_NAME_PREFIX + serviceVersion;
    ComponentName cpName = new ComponentName(context, serviceName);
    Intent service = new Intent();
    service.setComponent(cpName);
    context.getApplicationContext().bindService(service, connection, Context.BIND_AUTO_CREATE);

    the first and the second app has declared the same service, when the second app bind the service, it do not bind that service, but launch a new service with the same name.
     

    Advertisement

Share This Page

Loading...