Java Code Examples for android.os.Parcel.readValue()

The following are Jave code examples for showing how to use readValue() of the android.os.Parcel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: AURdroid   File: AurSearchResult.java   View Source Code Vote up 6 votes
private AurSearchResult(Parcel in) {
    this.iD = (Integer) in.readValue(Integer.class.getClassLoader());
    this.name = in.readString();
    this.packageBaseID = (Integer) in.readValue(Integer.class.getClassLoader());
    this.packageBase = in.readString();
    this.version = in.readString();
    this.description = in.readString();
    this.uRL = in.readString();
    this.numVotes = (Integer) in.readValue(Integer.class.getClassLoader());
    this.popularity = (Double) in.readValue(Double.class.getClassLoader());
    this.outOfDate = in.readString();
    this.maintainer = in.readString();
    this.firstSubmitted = (Integer) in.readValue(Integer.class.getClassLoader());
    this.lastModified = (Integer) in.readValue(Integer.class.getClassLoader());
    this.uRLPath = in.readString();
}
 
Example 2
Project: MovieApp   File: TvResult.java   View Source Code Vote up 6 votes
@SuppressWarnings({
    "unchecked"
})
public TvResult createFromParcel(Parcel in) {
    TvResult instance = new TvResult();
    instance.posterPath = ((String) in.readValue((String.class.getClassLoader())));
    instance.popularity = ((Double) in.readValue((Double.class.getClassLoader())));
    instance.id = ((Integer) in.readValue((Integer.class.getClassLoader())));
    instance.backdropPath = ((String) in.readValue((String.class.getClassLoader())));
    instance.voteAverage = ((Double) in.readValue((Double.class.getClassLoader())));
    instance.overview = ((String) in.readValue((String.class.getClassLoader())));
    instance.firstAirDate = ((String) in.readValue((String.class.getClassLoader())));
    in.readList(instance.originCountry, (String.class.getClassLoader()));
    in.readList(instance.genreIds, (Integer.class.getClassLoader()));
    instance.originalLanguage = ((String) in.readValue((String.class.getClassLoader())));
    instance.voteCount = ((Integer) in.readValue((Integer.class.getClassLoader())));
    instance.name = ((String) in.readValue((String.class.getClassLoader())));
    instance.originalName = ((String) in.readValue((String.class.getClassLoader())));
    return instance;
}
 
Example 3
Project: condom   File: TestService.java   View Source Code Vote up 6 votes
@Override public @Nullable IBinder onBind(final Intent intent) {
	return new Binder() {
		@Override protected boolean onTransact(final int code, final Parcel data, final Parcel reply, final int flags) throws RemoteException {
			try {
				final Class<?> clazz = Class.forName(data.readString());
				final Constructor<?> constructor = clazz.getDeclaredConstructors()[0];
				constructor.setAccessible(true);
				final Class<?>[] parameter_types = constructor.getParameterTypes();
				final Object[] args = new Object[parameter_types.length];
				for (int i = 0; i < args.length; i++) {
					if (parameter_types[i] == Context.class) args[i] = TestService.this;
					else if (parameter_types[i] == Application.class) args[i] = getApplication();
					else args[i] = data.readValue(getClassLoader());
				}
				final Procedure procedure = (Procedure) constructor.newInstance(args);
				procedure.run(TestService.this);
				reply.writeValue(null);
			} catch (final Throwable t) {
				reply.writeValue(t);
			}
			return true;
		}
	};
}
 
Example 4
Project: xlight_android_native   File: DeviceState.java   View Source Code Vote up 6 votes
private DeviceState(Parcel in) {
    deviceId = in.readString();
    name = (String) in.readValue(String.class.getClassLoader());
    isConnected = (Boolean) in.readValue(Boolean.class.getClassLoader());
    functions = new HashSet<>(Parcelables.readStringList(in));
    variables = Parcelables.readSerializableMap(in);
    version = (String) in.readValue(String.class.getClassLoader());
    deviceType = ParticleDevice.ParticleDeviceType.valueOf((String) in.readValue(String.class.getClassLoader()));
    platformId = (Integer) in.readValue(Integer.class.getClassLoader());
    productId = (Integer) in.readValue(Integer.class.getClassLoader());
    cellular = (Boolean) in.readValue(Boolean.class.getClassLoader());
    imei = (String) in.readValue(String.class.getClassLoader());
    currentBuild = (String) in.readValue(String.class.getClassLoader());
    defaultBuild = (String) in.readValue(String.class.getClassLoader());
    ipAddress = (String) in.readValue(String.class.getClassLoader());
    lastAppName = (String) in.readValue(String.class.getClassLoader());
    status = (String) in.readValue(String.class.getClassLoader());
    requiresUpdate = (Boolean) in.readValue(Boolean.class.getClassLoader());
    lastHeard = new Date((Long) in.readValue(Long.class.getClassLoader()));
}
 
Example 5
Project: MovieApp   File: Cast.java   View Source Code Vote up 6 votes
@SuppressWarnings({
    "unchecked"
})
public Cast createFromParcel(Parcel in) {
    Cast instance = new Cast();
    instance.adult = ((Boolean) in.readValue((Boolean.class.getClassLoader())));
    instance.character = ((String) in.readValue((String.class.getClassLoader())));
    instance.creditId = ((String) in.readValue((String.class.getClassLoader())));
    instance.id = ((Integer) in.readValue((Integer.class.getClassLoader())));
    instance.originalTitle = ((String) in.readValue((String.class.getClassLoader())));
    instance.posterPath = ((String) in.readValue((String.class.getClassLoader())));
    instance.releaseDate = ((String) in.readValue((String.class.getClassLoader())));
    instance.title = ((String) in.readValue((String.class.getClassLoader())));
    instance.mediaType = ((String) in.readValue((String.class.getClassLoader())));
    instance.episodeCount = ((Integer) in.readValue((Integer.class.getClassLoader())));
    instance.firstAirDate = ((String) in.readValue((String.class.getClassLoader())));
    instance.name = ((String) in.readValue((String.class.getClassLoader())));
    instance.originalName = ((String) in.readValue((String.class.getClassLoader())));
    return instance;
}
 
Example 6
Project: Android-app   File: MovieOverviewModel.java   View Source Code Vote up 5 votes
protected MovieOverviewModel(Parcel in) {
    this.id = (Long) in.readValue(Long.class.getClassLoader());
    this.adult = (Boolean) in.readValue(Boolean.class.getClassLoader());
    this.backdropPath = in.readString();
    this.budget = (Long) in.readValue(Long.class.getClassLoader());
    this.homepage = in.readString();
    this.imdbId = in.readString();
    this.originalLanguage = in.readString();
    this.originalTitle = in.readString();
    this.overview = in.readString();
    this.popularity = (Double) in.readValue(Double.class.getClassLoader());
    this.posterPath = in.readString();
    this.releaseDate = (Long) in.readValue(Long.class.getClassLoader());
    this.revenue = (Long) in.readValue(Long.class.getClassLoader());
    this.runtime = (Long) in.readValue(Long.class.getClassLoader());
    this.status = in.readString();
    this.tagline = in.readString();
    this.title = in.readString();
    this.video = (Boolean) in.readValue(Boolean.class.getClassLoader());
    this.voteAverage = (Double) in.readValue(Double.class.getClassLoader());
    this.voteCount = (Long) in.readValue(Long.class.getClassLoader());
    this.youtubeTrailer = in.readString();
    this.serverTitle = in.readString();
    this.serverId = in.readString();
    this.like = (Boolean) in.readValue(Boolean.class.getClassLoader());
    this.genres = in.createTypedArrayList(GenreModel.CREATOR);
    this.cast = new ArrayList<CastRelationModel>();
    in.readList(this.cast, CastRelationModel.class.getClassLoader());
    this.crew = new ArrayList<CrewRelationModel>();
    in.readList(this.crew, CrewRelationModel.class.getClassLoader());
}
 
Example 7
Project: dagger-test-example   File: City.java   View Source Code Vote up 5 votes
@SuppressWarnings({
    "unchecked"
})
public City createFromParcel(Parcel in) {
    City instance = new City();
    instance.id = ((int) in.readValue((int.class.getClassLoader())));
    instance.name = ((String) in.readValue((String.class.getClassLoader())));
    instance.coord = ((Coord) in.readValue((Coord.class.getClassLoader())));
    instance.country = ((String) in.readValue((String.class.getClassLoader())));
    instance.population = ((int) in.readValue((int.class.getClassLoader())));
    return instance;
}
 
Example 8
Project: dagger-test-example   File: City.java   View Source Code Vote up 5 votes
@SuppressWarnings({
    "unchecked"
})
public City createFromParcel(Parcel in) {
    City instance = new City();
    instance.id = ((int) in.readValue((int.class.getClassLoader())));
    instance.name = ((String) in.readValue((String.class.getClassLoader())));
    instance.coord = ((Coord) in.readValue((Coord.class.getClassLoader())));
    instance.country = ((String) in.readValue((String.class.getClassLoader())));
    instance.population = ((int) in.readValue((int.class.getClassLoader())));
    return instance;
}
 
Example 9
Project: MovieApp   File: Poster.java   View Source Code Vote up 5 votes
@SuppressWarnings({
    "unchecked"
})
public Poster createFromParcel(Parcel in) {
    Poster instance = new Poster();
    instance.aspectRatio = ((Double) in.readValue((Double.class.getClassLoader())));
    instance.filePath = ((String) in.readValue((String.class.getClassLoader())));
    instance.height = ((Integer) in.readValue((Integer.class.getClassLoader())));
    instance.iso6391 = ((String) in.readValue((String.class.getClassLoader())));
    instance.voteAverage = ((Double) in.readValue((Integer.class.getClassLoader())));
    instance.voteCount = ((Integer) in.readValue((Integer.class.getClassLoader())));
    instance.width = ((Integer) in.readValue((Integer.class.getClassLoader())));
    return instance;
}
 
Example 10
Project: GitHub   File: ProvinceBean.java   View Source Code Vote up 5 votes
protected ProvinceBean(Parcel in) {
  this.id = in.readString();
  this.name = in.readString();
  this.pinYin = in.readString();
  this.gisGcj02Lat = (Double) in.readValue(Double.class.getClassLoader());
  this.gisGcj02Lng = (Double) in.readValue(Double.class.getClassLoader());
  this.gisBd09Lat = (Double) in.readValue(Double.class.getClassLoader());
  this.gisBd09Lng = (Double) in.readValue(Double.class.getClassLoader());
  this.zipcode = in.readString();
  this.cityList = new ArrayList<CityBean>();
  in.readList(this.cityList, CityBean.class.getClassLoader());
}
 
Example 11
Project: GitHub   File: CityBean.java   View Source Code Vote up 5 votes
protected CityBean(Parcel in) {
    this.id = in.readString();
    this.name = in.readString();
    this.pinYin = in.readString();
    this.gisGcj02Lat = (Double) in.readValue(Double.class.getClassLoader());
    this.gisGcj02Lng = (Double) in.readValue(Double.class.getClassLoader());
    this.gisBd09Lat = (Double) in.readValue(Double.class.getClassLoader());
    this.gisBd09Lng = (Double) in.readValue(Double.class.getClassLoader());
    this.zipcode = in.readString();
    this.cityList = new ArrayList<DistrictBean>();
    in.readList(this.cityList, DistrictBean.class.getClassLoader());
}
 
Example 12
Project: MovieApp   File: Similar.java   View Source Code Vote up 5 votes
@SuppressWarnings({
    "unchecked"
})
public Similar createFromParcel(Parcel in) {
    Similar instance = new Similar();
    instance.page = ((Integer) in.readValue((Integer.class.getClassLoader())));
    in.readList(instance.movies, (Result.class.getClassLoader()));
    instance.totalPages = ((Integer) in.readValue((Integer.class.getClassLoader())));
    instance.totalResults = ((Integer) in.readValue((Integer.class.getClassLoader())));
    return instance;
}
 
Example 13
Project: GitHub   File: ParcelFn.java   View Source Code Vote up 5 votes
static <T> T unmarshall(byte[] array) {
    Parcel parcel = Parcel.obtain();
    parcel.unmarshall(array, 0, array.length);
    parcel.setDataPosition(0);
    Object value = parcel.readValue(CLASS_LOADER);
    parcel.recycle();
    return (T)value;
}
 
Example 14
Project: 9AnimeAndroid   File: RutoDownloadConfig.java   View Source Code Vote up 5 votes
protected RutoDownloadConfig(Parcel in) {
    anime = (Anime) in.readValue(Anime.class.getClassLoader());
    video = (Video) in.readValue(Video.class.getClassLoader());
    bufferSize = in.readInt();
    destination = in.readString();
    overwrite = in.readByte() != 0x00;
    timeout = in.readInt();
}
 
Example 15
Project: MovieApp   File: PersonSearchResult.java   View Source Code Vote up 5 votes
@SuppressWarnings({
    "unchecked"
})
public PersonSearchResult createFromParcel(Parcel in) {
    PersonSearchResult instance = new PersonSearchResult();
    instance.profilePath = ((String) in.readValue((Object.class.getClassLoader())));
    instance.adult = ((Boolean) in.readValue((Boolean.class.getClassLoader())));
    instance.id = ((Integer) in.readValue((Integer.class.getClassLoader())));
    in.readList(instance.knownFor, (KnownFor.class.getClassLoader()));
    instance.name = ((String) in.readValue((String.class.getClassLoader())));
    instance.popularity = ((Double) in.readValue((Double.class.getClassLoader())));
    return instance;
}
 
Example 16
Project: dagger-test-example   File: Wind.java   View Source Code Vote up 5 votes
@SuppressWarnings({
                          "unchecked"
                  })
public Wind createFromParcel(Parcel in)
{
    Wind instance = new Wind();
    instance.speed = ((Double) in.readValue((Double.class.getClassLoader())));
    instance.deg = ((Double) in.readValue((Double.class.getClassLoader())));
    return instance;
}
 
Example 17
Project: FuelUp   File: Expense.java   View Source Code Vote up 5 votes
private Expense(Parcel in) {
    this.id = (Long) in.readValue(Long.class.getClassLoader());
    this.vehicle = in.readParcelable(Vehicle.class.getClassLoader());
    this.price = (BigDecimal) in.readSerializable();
    long tmpDate = in.readLong();
    this.date = tmpDate == -1 ? null : new Date(tmpDate);
    this.info = in.readString();
}
 
Example 18
Project: JobSchedulerCompat   File: GcmIntentParser.java   View Source Code Vote up 4 votes
/**
 * Iterates over the map looking for the {@link #BUNDLE_KEY_CALLBACK} key to try and read the {@link IBinder}
 * straight from the parcelled data. This is entirely dependent on the implementation of Parcel, but these specific
 * parts of {@link Parcel} / {@link Bundle} haven't changed since 2008 and newer versions of Android will ship
 * with newer versions of Google Play services which embed the IBinder directly into the {@link Bundle}
 * (no need to deal with the {@link android.os.Parcelable} issues).
 */
GcmIntentParser(Bundle data) throws RuntimeException {
    if (data == null) {
        throw new IllegalArgumentException();
    }

    jobId = Integer.valueOf(data.getString(BUNDLE_KEY_TAG));

    extras = data.getBundle(BUNDLE_KEY_EXTRAS);

    triggeredContentUris = data.getParcelableArrayList(BUNDLE_KEY_TRIGGERED_URIS);

    if (triggeredContentUris != null) {
        triggeredContentAuthorities = new ArrayList<>();
        for (Uri triggeredContentUri : triggeredContentUris) {
            triggeredContentAuthorities.add(triggeredContentUri.getAuthority());
        }
    }

    Parcel parcel = toParcel(data);
    try {
        int numEntries = checkNonEmptyBundleHeader(parcel);
        for (int i = 0; i < numEntries; i++) {
            String key = null;
            if (shouldReadKeysAsStrings()) {
                key = parcel.readString();
            } else {
                Object entryKeyObj = parcel.readValue(getClass().getClassLoader());
                if (entryKeyObj instanceof String) {
                    key = (String) entryKeyObj;
                }
            }

            if (key == null) {
                continue;
            }

            if (BUNDLE_KEY_CALLBACK.equals(key)
                    && parcel.readInt() == VAL_PARCELABLE
                    && PENDING_CALLBACK_CLASS.equals(parcel.readString())) {
                callback = parcel.readStrongBinder();
                break;
            }
        }
    } finally {
        parcel.recycle();
    }

    if (extras == null || callback == null) {
        throw new IllegalArgumentException();
    }
}
 
Example 19
Project: order-by-android   File: Falta.java   View Source Code Vote up 4 votes
protected Falta(Parcel in) {
    id = in.readInt();
    faltas = in.readDouble();
    mes = in.readInt();
    materia = (Materia) in.readValue(Materia.class.getClassLoader());
}
 
Example 20
Project: Book-Shelf   File: Role.java   View Source Code Vote up 4 votes
protected Role(Parcel in) {
    this.name = in.readString();
    this.id = (Integer) in.readValue(Integer.class.getClassLoader());
    this.accessLevel = (Integer) in.readValue(Integer.class.getClassLoader());
}