Java Code Examples for android.os.Parcelable#describeContents()

The following examples show how to use android.os.Parcelable#describeContents() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File:    From spotify-web-api-android with MIT License 6 votes vote down vote up
public void allParcelables() throws IllegalAccessException, InstantiationException, NoSuchFieldException {

    ModelPopulator populator = new ModelPopulator("CREATOR", "$jacocoData");

    for (Class<? extends Parcelable> modelClass : getModelClasses()) {

        Parcelable instance = populator.populateWithRandomValues(modelClass);


        /* Trick to increase code coverage */
        ((Parcelable.Creator<?>) modelClass.getField("CREATOR").get(null)).newArray(13);
Example 2
Source File:    From mv2m with Apache License 2.0 5 votes vote down vote up
private static void writeParcelable(LinkedList<Object> parcelData, Parcelable parcelable, Parcel parcel1) {
    if (parcelable == null) {
    } else {
        parcelable.writeToParcel(parcel1, 0);