Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.os.Bundle;

public class Main {
    /**
     * Get parcelable object from bundle if it is not null
     * 
     * @param key
     * @param bundle
     * @return
     */
    @SuppressWarnings("unchecked")
    public static <T> T getParcelableFromBundleIfNotNull(String key, Bundle bundle) {
        return (T) (bundle == null ? null : bundle.getParcelable(key));
    }
}