Removes object from the bundle. - Android Android OS

Android examples for Android OS:Bundle

Description

Removes object from the bundle.

Demo Code


//package com.book2s;
import android.os.Bundle;

public class Main {
    /**//from   w w w.j a va2 s .  c o  m
     * Removes object from the bundle.
     *
     * @param clazz  of object
     * @param bundle to get from
     * @param <T>    type of object
     */
    public static <T> void removeFromBundle(Class<T> clazz, Bundle bundle) {
        if (bundle != null) {
            bundle.remove(clazz.getSimpleName());
        }
    }
}

Related Tutorials