Refine search
@Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeString(animationName); out.writeFloat(progress); out.writeInt(isAnimating ? 1 : 0); out.writeString(imageAssetsFolder); out.writeInt(repeatMode); out.writeInt(repeatCount); }
@Override public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); tagCount = tags.length; dest.writeInt(tagCount); dest.writeStringArray(tags); dest.writeInt(checkedPosition); dest.writeString(input); } }
@Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(name); dest.writeInt(numOfSeason); dest.writeInt(numOfEpisode); } private void readFromParcel(Parcel in) { name = in.readString(); numOfSeason = in.readInt(); numOfEpisode = in.readInt(); }
@Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(this.vuid); dest.writeString(this.packageName); dest.writeInt(this.clientJobId); }
@Override public void writeToParcel(Parcel dest, int flags) { dest.writeParcelable(otherClass, flags); dest.writeString(name); dest.writeInt(id); } private MyClass(Parcel in) { otherClass = (OtherClass) in.readParcelable(OtherClass.class.getClassLoader()); name = in.readString(); id = in.readInt(); }
@Test public void testWriteThenReadIsOkIfNotAtEnd() { parcel.writeInt(1); parcel.writeInt(2); parcel.writeInt(3); parcel.writeInt(4); parcel.setDataPosition(0); parcel.writeInt(5); assertThat(parcel.readInt()).isEqualTo(2); assertThat(parcel.readInt()).isEqualTo(3); assertThat(parcel.readInt()).isEqualTo(4); // This should succeed: while this is weird, the caller didn't clearly forget to reset the data // position, and is reading past the end of the parcel in a normal way. assertThat(parcel.readInt()).isEqualTo(0); }
@Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(elementId); dest.writeByte((byte) (isRoot ? 1 : 0)); dest.writeByte((byte) (isOrdered ? 1 : 0)); dest.writeStringArray(children); dest.writeInt(subFrames.length); for (Id3Frame subFrame : subFrames) { dest.writeParcelable(subFrame, 0); } }
@Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(chapterId); dest.writeInt(startTimeMs); dest.writeInt(endTimeMs); dest.writeLong(startOffset); dest.writeLong(endOffset); dest.writeInt(subFrames.length); for (Id3Frame subFrame : subFrames) { dest.writeParcelable(subFrame, 0); } }
public void writeToParcel(Parcel out, int flags){ out.writeInt(map.size()); for(Map.Entry<String,String> entry : map.entrySet()){ out.writeString(entry.getKey()); out.writeString(entry.getValue()); } } private MyParcelable(Parcel in){ //initialize your map before int size = in.readInt(); for(int i = 0; i < size; i++){ String key = in.readString(); String value = in.readString(); map.put(key,value); } }
@Override public void writeToParcel(Parcel out, int flags) { out.writeString(instanceId); out.writeStringArray(permissions); out.writeInt(requestCode); }
@Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(key); dest.writeInt(value.length); dest.writeByteArray(value); dest.writeInt(localeIndicator); dest.writeInt(typeIndicator); }
public void writeToParcel(Parcel out, int flags) { out.writeString(_mac); out.writeString(_pan); out.writeInt(_band); out.writeSerializable(_lqis); out.writeTypedList(_devices); } private ZigBeeNetwork(Parcel in) { _mac = in.readString(); _pan = in.readString(); _band = in.readInt(); _lqis = (ArrayList<Integer>) in.readSerializable(); in.readTypedList(_devices, ZigBeeDev.CREATOR); }
@Test public void testReadWriteMultipleInts() { for (int i = 0; i < 10; ++i) { parcel.writeInt(i); } parcel.setDataPosition(0); for (int i = 0; i < 10; ++i) { assertThat(parcel.readInt()).isEqualTo(i); } // now try to read past the number of items written and see what happens assertThat(parcel.readInt()).isEqualTo(0); }
@Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(this.mode); dest.writeInt(this.installFlags); dest.writeInt(this.installLocation); dest.writeLong(this.sizeBytes); dest.writeString(this.appPackageName); dest.writeParcelable(this.appIcon, flags); dest.writeString(this.appLabel); dest.writeLong(this.appIconLastModified); dest.writeParcelable(this.originatingUri, flags); dest.writeParcelable(this.referrerUri, flags); dest.writeString(this.abiOverride); dest.writeString(this.volumeUuid); dest.writeStringArray(this.grantedRuntimePermissions); }
@Override public void writeToParcel(Parcel dest, int flags) { dest.writeParcelable(this.filter, flags); dest.writeByte(this.hasDefault ? (byte) 1 : (byte) 0); dest.writeInt(this.labelRes); dest.writeString(this.nonLocalizedLabel); dest.writeInt(this.icon); dest.writeInt(this.logo); dest.writeInt(this.banner); } }
@Test public void testReadWriteStringInt() { for (int i = 0; i < 10; ++i) { parcel.writeString(Integer.toString(i)); parcel.writeInt(i); } parcel.setDataPosition(0); for (int i = 0; i < 10; ++i) { assertThat(parcel.readString()).isEqualTo(Integer.toString(i)); assertThat(parcel.readInt()).isEqualTo(i); } // now try to read past the number of items written and see what happens assertThat(parcel.readString()).isNull(); assertThat(parcel.readInt()).isEqualTo(0); }
@Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(this.imageUrl); dest.writeString(this.pageUrl); dest.writeInt(this.position); dest.writeInt(this.offsetX); dest.writeInt(this.offsetY); dest.writeInt(this.clipWidth); dest.writeInt(this.clipHeight); }