0

I am trying to make a request to another service (another app), but getting exception:

java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.myApp.DoAction } 

I did some readings and still confused:
Here, it's written: Since Android 5.0 (Lollipop) bindService() must always be called with an explicit intent.
Here, it's written: Implicit intents do not name a specific component, but instead declare a general action to perform, which allows a component from another app to handle it

What will be the right intent? What will be the right example? I am doing:

Intent intent = new Intent(Intent.ACTION_SEND); intent.setAction("com.anotherApp.MyService"); // binding to remote service bindService(intent, AddServiceConnection, Service.BIND_AUTO_CREATE); 

Many many thanks for help.

2 Answers 2

1

I believe that this Intent intent = new Intent(Intent.ACTION_SEND);

line of code says that intent action is implicit. It declares intent with abstract SEND action. try removing Intent.ACTION_SEND

Sign up to request clarification or add additional context in comments.

Comments

0

After trying some tutorials: Intent is implicit and this nice example shows how to deal with it

Intent intent = new Intent("com.anotherapp.MyService"); intent.setPackage("com.anotherapp"); bindService(intent, AddServiceConnection, Service.BIND_AUTO_CREATE); 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.