Java tutorial
//package com.java2s; /** ** Copyright (C) SAS Institute, All rights reserved. ** General Public License: http://www.opensource.org/licenses/gpl-license.php **/ import android.os.Bundle; import android.os.Parcelable; public class Main { /** * key used to extract from Bundle a String value, which is message's ID<br> * it is used when transferring a message by a few parcels<br> */ public static final String BUNDLE_SMALL_PARCEL_ID = "smallparcelid"; /** * Extract a String received from the test package engine. * The String message is extracted via Bundle.getCharArray using {@link #BUNDLE_SMALL_PARCEL_ID} as the key for the item. * * @param Parcelable Bundle received from the test package engine * @return String represents the ID of a message, generated at the engine side. * @see Bundle#putCharArray(String, char[]) * @see Bundle#getCharArray(String) * @see #setBundleOfSmallParcel(String, int, int) */ public static String getParcelableIDFromSmallParcel(Parcelable parcelable) { Bundle bundle = (Bundle) parcelable; return bundle.getString(BUNDLE_SMALL_PARCEL_ID); } }