Code example for Bundle

Methods: get

0
    @Override 
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
 
        // parse all input arguments 
        String recipientPhoneNumber = (String) icicle.get("recipient");
        if (recipientPhoneNumber != null) {
            mRecipient = recipientPhoneNumber;
        } 
        String numMsgStr = (String) icicle.get("messages");
        if (numMsgStr != null) {
            mNumberMessages = Integer.parseInt(numMsgStr);
        } 
        String msgFileNameStr = (String) icicle.get("messagefile");
        if (msgFileNameStr != null) {
            mMessageFileName = msgFileNameStr;
        } 
        String recpFileNameStr = (String) icicle.get("recipientfile");
        if (recpFileNameStr != null) {
            mRecipientFileName = recpFileNameStr;
        } 
        // user input is by seconds, convert to ms 
        String receiveTimerStr = (String) icicle.get("receivetimer");
        if (receiveTimerStr != null) {
            mReceiveTimer = (long)1000 * Integer.parseInt(receiveTimerStr);
        } 
        // user input is by seconds, convert to ms 
        String sendIntervalStr = (String) icicle.get("sendinterval");
        if (sendIntervalStr != null) {
            mSendInterval = (long)1000 * Integer.parseInt(sendIntervalStr);
        } 
    } 
}