Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
要在 AIDL 接口中导入非内置类型,我需要做一些具体的事情吗?特别是媒体播放器。当我尝试导入它时,我收到编译错误“找不到类 android.media.MediaPlayer 的导入”。
恐怕你不能从 AIDL 接口引用 android.media.MediaPlayer 。要将 MediaPlayer 包含在一个aidl 文件中,它需要有一个关联的aidl 接口文件,或者它需要是 Parcelable。这些都不是真的。
您能否更详细地描述您要实现的目标?可能有更好的方法来解决您的问题。