Android HashMap in Bundle?

后端 未结 7 2385
眼角桃花
眼角桃花 2020-12-02 11:57

The android.os.Message uses a Bundle to send with it\'s sendMessage-method. Therefore, is it possible to put a HashMap inside a

7条回答
  •  旧巷少年郎
    2020-12-02 12:16

    If you want to send all the keys in the bundle, you can try

    for(String key: map.keySet()){
        bundle.putStringExtra(key, map.get(key));
    }
    

提交回复
热议问题