Convert map To Bundle - Android Android OS

Android examples for Android OS:Bundle Map

Description

Convert map To Bundle

Demo Code


//package com.book2s;

import java.util.Map;

import android.os.Bundle;

public class Main {
    public static Bundle mapToBundle(Map<String, String> map) {
        Bundle bundle = new Bundle();
        for (String key : map.keySet()) {
            bundle.putString(key, map.get(key));
        }/*from www.  ja v  a  2s . c  o  m*/
        return bundle;
    }
}

Related Tutorials