Custom Classes Passed from Service to a UI threads via AIDL
- by Honza Pokorny
I have a service that regularly queries a web server for new messages. The service stores the new messages in an arrayList. These messages are implemented using a custom class, storing all kinds of metadata (strings and longs).
An activity then connects to this service to retrieve those messages and display them to the user.
I have an .aidl file that describes the interface that the service exposes.
package com.example.package;
interface MyInterface {
List<Message> getMessages();
}
The Message class extends the Parcelable class which should allow for the IPC transfer.
The problem is this: Eclipse gives me an error saying that the type of List<Message> is unknown. Any imports are marked as invalid.
Ideas? Thanks