Custom Classes Passed from Service to a UI threads via AIDL

Posted by Honza Pokorny on Stack Overflow See other posts from Stack Overflow or by Honza Pokorny
Published on 2010-05-30T20:50:53Z Indexed on 2010/05/30 20:52 UTC
Read the original article Hit count: 288

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about java

Related posts about android