Example usage for android.os Bundle readFromParcel

List of usage examples for android.os Bundle readFromParcel

Introduction

In this page you can find the example usage for android.os Bundle readFromParcel.

Prototype

public void readFromParcel(Parcel parcel) 

Source Link

Document

Reads the Parcel contents into this Bundle, typically in order for it to be passed through an IBinder connection.

Usage

From source file:com.jungle.base.utils.MiscUtils.java

public static Bundle bytesToBundle(byte[] bytes) {
    Bundle bundle = new Bundle();
    if (bytes == null || bytes.length == 0) {
        return bundle;
    }/*  w w w.  j ava 2  s.c  om*/

    Parcel accountInfoParcel = Parcel.obtain();
    accountInfoParcel.unmarshall(bytes, 0, bytes.length);
    accountInfoParcel.setDataPosition(0);
    bundle.readFromParcel(accountInfoParcel);
    accountInfoParcel.recycle();

    return bundle;
}