package com.m2sdl.undercooked.utils;

import android.app.Activity;
import android.os.Bundle;

public class ActivityUtils {
public static final String LATITUDE_KEY = "com.m2sdl.undercooked.map.RestaurantMarkerLatitude";
public static final String LONGITUDE_KEY = "com.m2sdl.undercooked.map.RestaurantMarkerLongitude";

    public static double getExtraAsDouble(Activity activity, String key) {
        // Source - https://stackoverflow.com/a/5265952
        // Posted by Will Tate, modified by community. See post 'Timeline' for change history
        // Retrieved 2026-02-26, License - CC BY-SA 3.0
        double newDouble;
        Bundle extras = activity.getIntent().getExtras();
        if (extras == null) {
            newDouble = 0.0;
        } else {
            newDouble = extras.getDouble(key);
        }
        return newDouble;
    }
}
