类android.os.ParcelFormatException源码实例Demo

下面列出了怎么用android.os.ParcelFormatException的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: android_9.0.0_r45   文件: KeymasterArgument.java
@Override
public KeymasterArgument createFromParcel(Parcel in) {
    final int pos = in.dataPosition();
    final int tag = in.readInt();
    switch (KeymasterDefs.getTagType(tag)) {
        case KeymasterDefs.KM_ENUM:
        case KeymasterDefs.KM_ENUM_REP:
        case KeymasterDefs.KM_UINT:
        case KeymasterDefs.KM_UINT_REP:
            return new KeymasterIntArgument(tag, in);
        case KeymasterDefs.KM_ULONG:
        case KeymasterDefs.KM_ULONG_REP:
            return new KeymasterLongArgument(tag, in);
        case KeymasterDefs.KM_DATE:
            return new KeymasterDateArgument(tag, in);
        case KeymasterDefs.KM_BYTES:
        case KeymasterDefs.KM_BIGNUM:
            return new KeymasterBlobArgument(tag, in);
        case KeymasterDefs.KM_BOOL:
            return new KeymasterBooleanArgument(tag, in);
        default:
            throw new ParcelFormatException("Bad tag: " + tag + " at " + pos);
    }
}
 
源代码2 项目: android_9.0.0_r45   文件: NetworkEvent.java
public NetworkEvent createFromParcel(Parcel in) {
    final int initialPosition = in.dataPosition();
    final int parcelToken = in.readInt();
    // we need to move back to the position from before we read parcelToken
    in.setDataPosition(initialPosition);
    switch (parcelToken) {
        case PARCEL_TOKEN_DNS_EVENT:
            return DnsEvent.CREATOR.createFromParcel(in);
        case PARCEL_TOKEN_CONNECT_EVENT:
            return ConnectEvent.CREATOR.createFromParcel(in);
        default:
            throw new ParcelFormatException("Unexpected NetworkEvent token in parcel: "
                    + parcelToken);
    }
}
 
源代码3 项目: StockChart-MPAndroidChart   文件: Entry.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeFloat(this.x);
    dest.writeFloat(this.getY());
    if (getData() != null) {
        if (getData() instanceof Parcelable) {
            dest.writeInt(1);
            dest.writeParcelable((Parcelable) this.getData(), flags);
        } else {
            throw new ParcelFormatException("Cannot parcel an Entry with non-parcelable data");
        }
    } else {
        dest.writeInt(0);
    }
}
 
源代码4 项目: Ticket-Analysis   文件: Entry.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeFloat(this.x);
    dest.writeFloat(this.getY());
    if (getData() != null) {
        if (getData() instanceof Parcelable) {
            dest.writeInt(1);
            dest.writeParcelable((Parcelable) this.getData(), flags);
        } else {
            throw new ParcelFormatException("Cannot parcel an Entry with non-parcelable data");
        }
    } else {
        dest.writeInt(0);
    }
}
 
源代码5 项目: android-kline   文件: Entry.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeFloat(this.x);
    dest.writeFloat(this.getY());
    if (getData() != null) {
        if (getData() instanceof Parcelable) {
            dest.writeInt(1);
            dest.writeParcelable((Parcelable) this.getData(), flags);
        } else {
            throw new ParcelFormatException("Cannot parcel an Entry with non-parcelable data");
        }
    } else {
        dest.writeInt(0);
    }
}
 
源代码6 项目: Stayfit   文件: Entry.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeFloat(this.mVal);
    dest.writeInt(this.mXIndex);
    if (mData != null) {
        if (mData instanceof Parcelable) {
            dest.writeInt(1);
            dest.writeParcelable((Parcelable) this.mData, flags);
        } else {
            throw new ParcelFormatException("Cannot parcel an Entry with non-parcelable data");
        }
    } else {
        dest.writeInt(0);
    }
}
 
源代码7 项目: NetKnight   文件: Entry.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeFloat(this.mVal);
    dest.writeInt(this.mXIndex);
    if (mData != null) {
        if (mData instanceof Parcelable) {
            dest.writeInt(1);
            dest.writeParcelable((Parcelable) this.mData, flags);
        } else {
            throw new ParcelFormatException("Cannot parcel an Entry with non-parcelable data");
        }
    } else {
        dest.writeInt(0);
    }
}
 
源代码8 项目: JNChartDemo   文件: Entry.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeFloat(this.mVal);
    dest.writeInt(this.mXIndex);
    if (mData != null) {
        if (mData instanceof Parcelable) {
            dest.writeInt(1);
            dest.writeParcelable((Parcelable) this.mData, flags);
        } else {
            throw new ParcelFormatException("Cannot parcel an Entry with non-parcelable data");
        }
    } else {
        dest.writeInt(0);
    }
}
 
 类所在包
 同包方法