/** * Save and get ArrayList in SharedPreference */ public void saveArrayList(ArrayList<String> list, String key){ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity); SharedPreferences.Editor editor = prefs.edit(); Gson gson = new Gson(); String json = gson.toJson(list); editor.putString(key, json); editor.apply(); // This line is IMPORTANT !!! } public ArrayList<String> getArrayList(String key){ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity); Gson gson = new Gson(); String json = prefs.getString(key, null); Type type = new TypeToken<ArrayList<String>>() {}.getType(); return gson.fromJson(json, type); }
Location for the config yml file /home/example/.ngrok2/ngrok.yml content of config file authtoken: 4nq9771bPxe8ctg7LKr_2ClH7Y15Zqe4bWLWF9p tunnels: app-foo: addr: 80 proto: http host_header: app-foo.dev app-bar: addr: 80 proto: http host_header: app-bar.dev how to start ngrok with considering the config file: ngrok start --all
Comments
Post a Comment