I was experimenting on creating a service that can be called in a
browser but unfortunately it doesn't get called at all. Is there
something wrong with this intent-filter I placed for the service?
<service android:name=".MyService" android:label="@string/app_name"
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="myService" android:host="www.sample.com"/>
</intent-filter>
</service>
For the service code, I just extend the IntentService class and place
my logic on the onHandleIntent method.
This is how I call it in the website:
<html>
<head></head>
<body>
<a href="myService://www.sample.com?Data=my sample data">Call Service</
a>
</body>
</html>
That intent-filter works if I placed it on an activity but when it is
a service, it does not work. I will get this error from the LogCat:
tag=Tab
Message=onReceivedError -10 myService://www.sample.com?Data=my sample
data
Any idea if it is possible to call the service from a browser at all?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en