Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: AIDL parameter receiving null

Tags:

android

aidl

I got an activity and a service that are binded.

When the onServiceConnected is called in the ServiceConnection, I do the next thing:

mInterfaceObject = IInterface1.Stub.asInterface(arg1);

mInterfaceObject.register(mController);

Where mController is:

private final IInterface2.Stub mController = new IInterface2.Stub() {

Both IInterface1 and IInterface2 are AIDL files.

Now the problem. In the implementation of the register in the service. The parameter will be null.

What am I doing wrong?

like image 440
Ion Aalbers Avatar asked Dec 13 '22 04:12

Ion Aalbers


1 Answers

Eclipse automatically added the next method

    @Override
    public IBinder asBinder() {
        return null;
    };

This messed up the whole communication. This method shouldn't be overridden.

like image 104
Ion Aalbers Avatar answered Jan 04 '23 09:01

Ion Aalbers