package com.example.general.myapplication.entity;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.v4.util.ArrayMap;
/**
* Created by lenovo on 2016/7/1.
*/
public class TestMessage implements Parcelable {
private String to;
private String from;
private ArrayMap<String, String> data = new ArrayMap<>();
private String messageType;
private String messageId;
private long sendTime;
private TestNotification notification;
public String getMessageType() {
return messageType;
}
public void setMessageType(String messageType) {
this.messageType = messageType;
}
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public long getSendTime() {
return sendTime;
}
public void setSendTime(long sendTime) {
this.sendTime = sendTime;
}
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public ArrayMap<String, String> getData() {
return data;
}
public void setData(ArrayMap<String, String> data) {
this.data = data;
}
public TestNotification getNotification() {
return notification;
}
public void setNotification(TestNotification notification) {
this.notification = notification;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(to);
dest.writeString(from);
dest.writeParcelable(notification, flags);
dest.writeLong(sendTime);
// dest.writeInt(data.size());
// for (Map.Entry<String, String> entry : data.entrySet()) {
// dest.writeString(entry.getKey());
// dest.writeString(entry.getValue());
// }
dest.writeMap(data);
}
static Creator<TestMessage> CREATOR = new Creator<TestMessage>() {
@Override
public TestMessage createFromParcel(Parcel source) {
return new TestMessage(source);
}
@Override
public TestMessage[] newArray(int size) {
return new TestMessage[size];
}
};
private TestMessage(Parcel source) {
to = source.readString();
from = source.readString();
notification = source.readParcelable(TestNotification.class.getClassLoader());
sendTime = source.readLong();
// int size = source.readInt();
// for (int i = 0; i < size; i++) {
// String key = source.readString();
// String value = source.readString();
// data.put(key, value);
// }
source.readMap(data, ArrayMap.class.getClassLoader());
}
public TestMessage() {
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
Android通过Parcelable和Serializable实现各种类型嵌套序列化
共59个文件
ds_store:25个
xml:8个
java:7个
需积分: 34 39 下载量 86 浏览量
2016-07-03
18:58:18
上传
评论
收藏 133KB ZIP 举报
温馨提示
Android通过Parcelable和Serializable实现各种类型嵌套序列化
资源推荐
资源详情
资源评论
收起资源包目录
Android Parcelable_Serializable.zip (59个子文件)
Android Parcelable_Serializable
gradle
wrapper
gradle-wrapper.jar 52KB
gradle-wrapper.properties 231B
.DS_Store 6KB
local.properties 445B
build.gradle 498B
gradlew.bat 2KB
gradlew 5KB
app
.gitignore 7B
build.gradle 646B
proguard-rules.pro 674B
app.iml 10KB
libs
src
test
java
com
example
.DS_Store 6KB
general
.DS_Store 6KB
myapplication
ExampleUnitTest.java 326B
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
main
AndroidManifest.xml 805B
java
com
example
.DS_Store 6KB
general
.DS_Store 6KB
myapplication
MainActivity.java 2KB
Main2Activity.java 2KB
.DS_Store 6KB
entity
TestNotification.java 3KB
TestMessage.java 3KB
CityVO.java 163B
.DS_Store 6KB
.DS_Store 6KB
aidl
com
example
.DS_Store 6KB
general
.DS_Store 6KB
myapplication
IMyAidlInterface.aidl 429B
.DS_Store 6KB
.DS_Store 6KB
res
values
styles.xml 383B
colors.xml 208B
strings.xml 77B
dimens.xml 211B
mipmap-xxhdpi
ic_launcher.png 8KB
layout
activity_main2.xml 772B
activity_main.xml 778B
mipmap-xhdpi
ic_launcher.png 5KB
mipmap-hdpi
ic_launcher.png 3KB
drawable
mipmap-mdpi
ic_launcher.png 2KB
values-w820dp
dimens.xml 358B
.DS_Store 10KB
mipmap-xxxhdpi
ic_launcher.png 10KB
.DS_Store 6KB
androidTest
java
com
example
.DS_Store 6KB
general
.DS_Store 6KB
myapplication
ApplicationTest.java 364B
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
gradle.properties 873B
MyApplication.iml 944B
.DS_Store 6KB
settings.gradle 15B
共 59 条
- 1
资源评论
mahaiming1990
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功