intent From Byte Array - Android android.os

Android examples for android.os:Parcel

Description

intent From Byte Array

Demo Code


//package com.java2s;

import android.content.Intent;

import android.os.Parcel;

public class Main {
    public static Intent intentFromByteArray(byte[] byteArray) {
        Parcel obtain = Parcel.obtain();
        obtain.unmarshall(byteArray, 0, byteArray.length);
        obtain.setDataPosition(0);//from  w ww  . j  a  v  a 2  s .  c o  m
        Intent createFromParcel = Intent.CREATOR.createFromParcel(obtain);
        obtain.recycle();
        return createFromParcel;
    }
}

Related Tutorials