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 an int value, which is the index of parcels of a message<br> * it is used when transferring a message by a few parcels<br> */ public static final String BUNDLE_SMALL_PARCEL_INDEX = "smallparcelindex"; /** * Extract a int received from the test package engine. * The int message is extracted via Bundle.getCharArray using {@link #BUNDLE_SMALL_PARCEL_INDEX} as the key for the item. * * @param Parcelable Bundle received from the test package engine * @return int represents the index of a parcel of a whole message, generated at the engine side. * @see Bundle#putCharArray(String, char[]) * @see Bundle#getCharArray(String) * @see #setBundleOfSmallParcel(String, int, int) */ public static int getParcelableIndexFromSmallParcel(Parcelable parcelable) { Bundle bundle = (Bundle) parcelable; return bundle.getInt(BUNDLE_SMALL_PARCEL_INDEX); } }