Question

I have class X that implements Queue.

I want to pass Class X's Object into AIDL interface. When i am importing class X in .aidl File Eclipse shows an error and says "could not find import for class com.test.X." although the class is there.

package com.test

public class X implements Queue<byte[]>{


public LinkedList<byte[]> que = new LinkedList<byte[]>();

int push =0, pop = 0;

public Iterator<byte[]> iterate = null;

public X()
{
    iterate = que.iterator();// TODO Auto-generated constructor stub
}
}

As searching around on Google i have found that You must create a separate .aidl file for each class you wish to use within your service.So, i have created X.aidl but it didnt work. can any one suggest something?

Thanks.

Was it helpful?

Solution

Try to make your class implementing Parcelable interface. So in your case the declaration will be like:

public class X implements Queue<byte[]>, Parcelable {}

You can read here how to implement Parcelable interface.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top