android.os.Parcel.writeList()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(285)

本文整理了Java中android.os.Parcel.writeList()方法的一些代码示例,展示了Parcel.writeList()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parcel.writeList()方法的具体详情如下:
包路径:android.os.Parcel
类名称:Parcel
方法名:writeList

Parcel.writeList介绍

[英]Flatten a List into the parcel at the current dataPosition(), growing dataCapacity() if needed. The List values are written using #writeValue and must follow the specification there.
[中]将列表展平到当前dataPosition()处的地块中,必要时增加dataCapacity()。列表值是使用#writeValue编写的,必须遵循其中的规范。

代码示例

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeInt(this.count);
  dest.writeList(this.games);
}

代码示例来源:origin: jaydenxiao2016/AndroidFire

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(this.title);
  dest.writeList(this.pictures);
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeInt(this.total_count);
  dest.writeInt(this.total_page);
  dest.writeList(this.result);
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeInt(this.pages);
  dest.writeInt(this.count);
  dest.writeList(this.list);
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeInt(this.count);
  dest.writeInt(this.pages);
  dest.writeList(this.vlist);
}

代码示例来源:origin: gotev/android-upload-service

@Override
public void writeToParcel(Parcel parcel, int arg1) {
  parcel.writeString(method);
  parcel.writeString(customUserAgent);
  parcel.writeByte((byte) (usesFixedLengthStreamingMode ? 1 : 0));
  parcel.writeList(requestHeaders);
  parcel.writeList(requestParameters);
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeInt(this.code);
  dest.writeString(this.message);
  dest.writeString(this.ver);
  dest.writeList(this.data);
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeInt(this.tid);
  dest.writeInt(this.reid);
  dest.writeString(this.name);
  dest.writeString(this.logo);
  dest.writeString(this.gotoX);
  dest.writeString(this.param);
  dest.writeList(this.children);
}

代码示例来源:origin: gotev/android-upload-service

@Override
public void writeToParcel(Parcel parcel, int arg1) {
  parcel.writeString(id);
  parcel.writeString(serverUrl);
  parcel.writeInt(maxRetries);
  parcel.writeByte((byte) (autoDeleteSuccessfullyUploadedFiles ? 1 : 0));
  parcel.writeParcelable(notificationConfig, 0);
  parcel.writeList(files);
}

代码示例来源:origin: mancj/MaterialSearchBar

@Override
  public void writeToParcel(Parcel out, int flags) {
    super.writeToParcel(out, flags);
    out.writeInt(isSearchBarVisible);
    out.writeInt(suggestionsVisible);
    out.writeInt(speechMode);
    out.writeInt(searchIconRes);
    out.writeInt(navIconResId);
    out.writeString(hint);
    out.writeList(suggestions);
    out.writeInt(maxSuggestions);
  }
}

代码示例来源:origin: hidroh/materialistic

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeList(list);
  dest.writeStringList(new ArrayList<>(expanded));
}

代码示例来源:origin: stackoverflow.com

public class ClassABC implements Parcelable {

 private List<MyClass> mObjList; // MyClass should implement Parcelable properly

 // ==================== Parcelable ====================
 public int describeContents() {
  return 0;
 }

 public void writeToParcel(Parcel out, int flags) {
  out.writeList(mObjList);
 }

 private ClassABC(Parcel in) {
  mObjList = new ArrayList<MyClass>();
  in.readList(mObjList, getClass().getClassLoader());
  }

 public static final Parcelable.Creator<ClassABC> CREATOR = new Parcelable.Creator<ClassABC>() {
  public ClassABC createFromParcel(Parcel in) {
   return new ClassABC(in);
  }
  public ClassABC[] newArray(int size) {
   return new ClassABC[size];
  }
 };

}

代码示例来源:origin: stackoverflow.com

@SuppressWarnings("unchecked")
public D (Parcel in) {
  list = new ArrayList<IA>();
  (...)    
  //ERROR -> list = (ArrayList<IA>) in.readSerializable 
  list = in.readArrayList(IA.class.getClassLoader());
}

@SuppressWarnings("rawtypes")
public static final Parcelable.Creator CREATOR =
new Parcelable.Creator() {
  public D createFromParcel(Parcel in) {
    return new D(in);
  }

  public D[] newArray(int size) {
    return new D[size];
  }
};

public int describeContents() {
  return 0;
}

public void writeToParcel(Parcel dest, int flags) {
  (...)
  dest.writeList(list);
}

代码示例来源:origin: arimorty/floatingsearchview

@Override
public void writeToParcel(Parcel out, int flags) {
  super.writeToParcel(out, flags);
  out.writeList(suggestions);
  out.writeInt(isFocused ? 1 : 0);
  out.writeString(query);
  out.writeInt(queryTextSize);
  out.writeInt(suggestionTextSize);
  out.writeString(searchHint);
  out.writeInt(dismissOnOutsideClick ? 1 : 0);
  out.writeInt(showMoveSuggestionUpBtn ? 1 : 0);
  out.writeInt(showSearchKey ? 1 : 0);
  out.writeInt(isTitleSet ? 1 : 0);
  out.writeInt(backgroundColor);
  out.writeInt(suggestionsTextColor);
  out.writeInt(queryTextColor);
  out.writeInt(searchHintTextColor);
  out.writeInt(actionOverflowMenuColor);
  out.writeInt(menuItemIconColor);
  out.writeInt(leftIconColor);
  out.writeInt(clearBtnColor);
  out.writeInt(suggestionUpBtnColor);
  out.writeInt(dividerColor);
  out.writeInt(menuId);
  out.writeInt(leftActionMode);
  out.writeInt(dimBackground ? 1 : 0);
  out.writeLong(suggestionsSectionAnimSuration);
  out.writeInt(dismissOnSoftKeyboardDismiss ? 1 : 0);
  out.writeInt(dismissFocusOnSuggestionItemClick ? 1 : 0);
}

代码示例来源:origin: jaydenxiao2016/AndroidFire

dest.writeString(this.tname);
dest.writeString(this.ptime);
dest.writeList(this.ads);
dest.writeList(this.imgextra);

代码示例来源:origin: Rukey7/MvpApp

dest.writeString(this.specialID);
dest.writeTypedList(this.ads);
dest.writeList(this.imgextra);

代码示例来源:origin: stackoverflow.com

dest.writeString(text);
dest.writeString(image);
dest.writeList(choices);

代码示例来源:origin: parse-community/Parse-SDK-Android

void writeToParcel(Parcel dest, ParseParcelEncoder encoder) {
    dest.writeList(coordinates);
  }
}

代码示例来源:origin: kaku2015/ColorfulNews

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(this.title);
  dest.writeList(this.pictures);
}

代码示例来源:origin: thoughtbot/expandable-recycler-view

@Override
public void writeToParcel(Parcel dest, int flags) {
 dest.writeString(title);
 if (items == null) {
  dest.writeByte((byte) (0x00));
  dest.writeInt(0);
 } else {
  dest.writeByte((byte) (0x01));
  dest.writeInt(items.size());
  final Class<?> objectsType = items.get(0).getClass();
  dest.writeSerializable(objectsType);
  dest.writeList(items);
 }
}

相关文章

Parcel类方法