Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.content.Context;
import android.content.SharedPreferences;

import java.util.HashMap;

import java.util.Map;

public class Main {
    public static void storeDistanceAndLocation(Context context, HashMap<String, String> params) {
        SharedPreferences sharedPref = context.getSharedPreferences("DistanceAndLocation", Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = sharedPref.edit();
        for (Map.Entry<String, String> entry : params.entrySet()) {
            editor.putString(entry.getKey(), entry.getValue());
        }
        editor.apply();
    }
}