diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index fa2a67f..c7e41b7 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -4,6 +4,7 @@ + keysAsJson = gson.fromJson(keys, ArrayList.class); + SharedPreferences.Editor editor = prefs.edit(); + editor.putString(KboardIME.Keys.STORAGE_KEY, keys); + editor.apply(); + Toast toast = Toast.makeText(this.getActivity(), "Imported " + keysAsJson.size() + " keys!", Toast.LENGTH_SHORT); + toast.show(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } } @Override diff --git a/app/src/main/res/xml/prefs.xml b/app/src/main/res/xml/prefs.xml index a633535..ae6f7a6 100644 --- a/app/src/main/res/xml/prefs.xml +++ b/app/src/main/res/xml/prefs.xml @@ -11,6 +11,8 @@ + +