Android import non-built-in type in AIDL

1.1k Views Asked by At

Is there something specific I have to do to import a non-built-in type in an AIDL interface? Specifically MediaPlayer. When I try to import it i get the compile error "couldn't find import for class android.media.MediaPlayer".

1

There are 1 best solutions below

2
On

I'm afraid you can't reference android.media.MediaPlayer from an AIDL interface. To include MediaPlayer in an aidl file, it needs to have an associated aidl interface file or it needs to be Parcelable. Neither of these is true.

Could you describe in more detail what you are trying to achieve? There could be a better approach to solve your problem.