intercept Parcelable Param from Bundle - Android android.os

Android examples for android.os:Bundle

Description

intercept Parcelable Param from Bundle

Demo Code

import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;

public class Main{

    public static Parcelable interceptParcelableParam(
            Bundle savedInstanceState, Intent intent, String paramName) {
        Parcelable ret = null;//w ww . jav  a  2s  .  com

        if (savedInstanceState != null) {
            ret = savedInstanceState.getParcelable(paramName);
        } else {
            if (intent != null) {
                Bundle incomming = intent.getExtras();
                if (incomming != null) {
                    ret = incomming.getParcelable(paramName);
                }
            }
        }

        return ret;
    }

}

Related Tutorials