bundle From Byte Array - Android android.os

Android examples for android.os:Bundle

Description

bundle From Byte Array

Demo Code


//package com.java2s;

import android.os.Bundle;
import android.os.Parcel;

public class Main {
    public static Bundle bundleFromByteArray(byte[] byteArray) {
        Parcel obtain = Parcel.obtain();
        obtain.unmarshall(byteArray, 0, byteArray.length);
        obtain.setDataPosition(0);/*w w w .j av a 2  s. c  o m*/
        Bundle result = Bundle.CREATOR.createFromParcel(obtain);
        obtain.recycle();
        return result;
    }
}

Related Tutorials