Android studio 使用AIDL 无法import class问题解决
来源:互联网 发布:matlab矩阵绝对值 编辑:程序博客网 时间:2024/04/30 10:28
在用android studio 用AIDL的过程中,AIDL默认支持的数据类型如下(来自android文档):
By default, AIDL supports the following data types:
- All primitive types in the Java programming language (such as
int
,long
,char
,boolean
, and so on) String
CharSequence
List
All elements in the
List
must be one of the supported data types in this list or one of the other AIDL-generated interfaces or parcelables you've declared. AList
may optionally be used as a "generic" class (for example,List<String>
). The actual concrete class that the other side receives is always anArrayList
, although the method is generated to use theList
interface.Map
All elements in the
Map
must be one of the supported data types in this list or one of the other AIDL-generated interfaces or parcelables you've declared. Generic maps, (such as those of the formMap<String,Integer>
are not supported. The actual concrete class that the other side receives is always aHashMap
, although the method is generated to use theMap
interface.
You must include an import
statement for each additional type not listed above, even if they are defined in the same package as your interface.
如果不是AIDL数据类型,需要自己定义一个新的AIDL文件并实现parcelable接口,示例如下:
For example, here is a Rect.aidl
file to create a Rect
class that's parcelable:
package android.graphics;// Declare Rect so AIDL can find it and knows that it implements// the parcelable protocol.parcelable Rect;
And here is an example of how the Rect
class implements theParcelable
protocol.
import android.os.Parcel;import android.os.Parcelable;public final class Rect implements Parcelable {
以上两步做完后并不能编译通过,在使用android studio的时候会有类似如下的错误
Error:(5) couldn't find import for class com.XXX.xxx
通过在在android-studio\sdk\platforms\android-19\framework.aidl添加如下内容解决
parcelable com.XXX.xxx;
- Android studio 使用AIDL 无法import class问题解决
- Android studio import aidl
- Android Studio中使用AIDL以及couldn't find import for class问题的处理
- android studio aidl couldn't find import for class
- android aidl出现无法import
- Android Studio 使用AIDL
- Android Studio 使用AIDL
- Android Studio 使用AIDL
- Android Studio使用AIDL时无法找到自定义的类
- Android aidl 编译报couldn't find import for class
- Android aidl 编译报couldn't find import for class
- Android aidl 编译错误:couldn't find import for class
- Android Studio AIDL 的使用 。
- Android Studio中使用AIDL
- android studio 中使用aidl
- Android Studio如何使用aidl
- 【转载】Android Studio 使用AIDL
- Android Studio 如何使用AIDL
- order by和group by的总结
- 分布式编译工具
- Microsoft Visual studio 2012 professional 序列号亲测可用
- iOS开发资源
- Jfinal+POI导出Excel
- Android studio 使用AIDL 无法import class问题解决
- 一个大龄女程序猿的烦恼
- 怎样使用事件以及IE和DOM事件模型之间存在哪些主要差别
- VC2012调用_tsplitpath_s,产生ERANGE(34)的错误
- VB.NET使用API技巧讲解
- 微服务的优缺点
- Java Hessian小试(转)
- Git远程操作详解
- 而他不能这样做 许多影子纤尘不染的别去