Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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 generic String message from Bundle. */
    public static final String BUNDLE_MESSAGE = "message";

    /**
     * Extract the String message received from the test package engine.
     * The String message is retrieved via Bundle.getString using {@link #BUNDLE_MESSAGE} as the key for the item. 
     * @param Parcelable Bundle received from the TCP Messenger Service.
     * @return String message, if present
     * @see Bundle#putString(String, String)
     * @see Bundle#getString(String) 
     */
    public static String getParcelableMessage(Parcelable parcelable) {
        Bundle bundle = (Bundle) parcelable;
        return bundle.getString(BUNDLE_MESSAGE);
    }
}