get Values from Bundle and returns a Map - Android android.os

Android examples for android.os:Bundle

Description

get Values from Bundle and returns a Map

Demo Code

import java.util.HashMap;
import java.util.Map;

import android.os.Bundle;

public class Main {

  public static Map<String, Object> getValues(final Bundle bundle) {
    HashMap<String, Object> values = new HashMap<String, Object>();
    if (bundle == null) {
      return values;
    }/*from   w w  w . ja v  a 2  s  .c om*/
    for (String key : bundle.keySet()) {
      values.put(key, bundle.get(key));
    }
    return values;
  }

}

Related Tutorials