Android Question start service in a second app with intent

Discussion in 'Android Questions' started by brunnlechner, Feb 24, 2019.

  1. brunnlechner

    brunnlechner Member Licensed User

    The first code was OK, since android:targetSdkVersion="26"
    Error: Service Intent must be explicit...

    With the others there is no reaction in the Provider APP

    Requester App:

    Code:
    Dim in As Intent
        
    in.Initialize("provider.app.REQUEST","")
        
    'in.SetComponent("provider.app/.S1")
        in.AddCategory("android.intent.category.DEFAULT")
        
    in.PutExtra("test","True")
        
    StartService(in)



    Provider App Manifest:
    Code:
    AddServiceText(S1, <intent-filter>
       <action android:name=
    "provider.app.REQUEST" />
       <category android:name=
    "android.intent.category.DEFAULT" />
    </
    intent-filter>)
     

    Attached Files:

    Last edited: Feb 24, 2019
  2. DonManfred

    DonManfred Expert Licensed User

    Do you get any error? WHICH one?
    What exactly is the question?
     
  3. brunnlechner

    brunnlechner Member Licensed User

    This code was OK, since android:targetSdkVersion="26":
    Code:
    Dim in As Intent
        
    in.Initialize("provider.app.REQUEST","")
        
    'in.SetComponent("provider.app/.S1")
        in.AddCategory("android.intent.category.DEFAULT")
        
    in.PutExtra("test","True")
        
    StartService(in)
    targetSdkVersion="26 = OK
    targetSdkVersion="26: Error: Service Intent must be explicit...

    All other attempts did not work

    Regards Franz
     
    Last edited: Feb 24, 2019
  4. Erel

    Erel Administrator Staff Member Licensed User

    Try to add:
    Code:
    in.SetPackage("provider.app"'assuming that this is the target app package name
     
  5. OliverA

    OliverA Well-Known Member Licensed User

    Are you also writing the provider app or is it third party?
     
  6. brunnlechner

    brunnlechner Member Licensed User

    Thanks Erel, you're the best - it works perfectly again.

    Code:
    Dim in As Intent
    in.Initialize("provider.app.REQUEST","")
    in.SetPackage("provider.app"
    in.AddCategory("android.intent.category.DEFAULT")
    in.PutExtra("test","True")
    StartService(in)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice