On Mon, Nov 22, 2010 at 6:38 AM, Aluvala Suman <aluvala.su...@gmail.com> wrote:
> I am trying to access a service in other package, but not able to get the
> binder.
>
> Attached my file hierarchy.
> This is the manifest file for the ExampleService package
> <?xml version="1.0" encoding="utf-8"?>
> <manifest xmlns:android="http://schemas.android.com/apk/res/android";
>     package="example.service" android:versionCode="1"
> android:versionName="1.0">
>     <application android:icon="@drawable/icon"
> android:label="@string/app_name">
>         <service android:enabled="true" android:label="ExampleService"
>             android:name=".ExampleService">
>             <intent-filter>
>                 <action android:name="android.intent.action.MAIN" />
>                 <category android:name="android.intent.category.LAUNCHER" />
>             </intent-filter>
>         </service>

A <service> should not have that <intent-filter>. Please use an
<intent-filter> like:

<intent-filter>
<action android:name="my.totally.unique.NAME" />
</intent-filter>

> In the ExampleActivity i am accessing the service by doing
>
> import example.service.IExampleService;
> .....
>
>         ServiceIntent = new Intent();
>         //ServiceIntent.setComponent(new ComponentName("example.service",
> "example.service.IExampleService"));
>         ServiceIntent.setClassName("example.service",
> "example.service.IExampleService");
>         bindService(ServiceIntent, conn, BIND_AUTO_CREATE);

Use:

serviceIntent = new Intent("my.totally.unique.NAME");

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to