package com.atmob.keyboard_android.util.jump;

import android.content.Intent;
import android.os.Bundle;

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

/**
 * Intent工具类
 */
public class IntentUtil {
    /**
     * Intent参数转Map
     */
    public static Map<String, Object> intentToMap(Intent intent) {
        Map<String, Object> map = new HashMap<>();
        if (intent == null) {
            return map;
        }
        Bundle extras = intent.getExtras();
        if (extras != null) {
            for (String key : extras.keySet()) {
                map.put(key, extras.get(key));
            }
        }
        return map;
    }
}