commit
832b08043a
1 changed files with 9 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
package info.nightscout.utils;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -25,10 +26,12 @@ import info.nightscout.androidaps.R;
|
|||
/**
|
||||
* Created by mike on 03.07.2016.
|
||||
*/
|
||||
|
||||
public class ImportExportPrefs {
|
||||
static File path = new File(Environment.getExternalStorageDirectory().toString());
|
||||
static final File file = new File(path, MainApp.resources.getString(R.string.app_name) + "Preferences");
|
||||
|
||||
|
||||
//exports shared Preferences
|
||||
public static void exportSharedPreferences(final Context c) {
|
||||
|
||||
|
@ -48,7 +51,10 @@ public class ImportExportPrefs {
|
|||
pw.close();
|
||||
fw.close();
|
||||
ToastUtils.showToastInUiThread(c, MainApp.resources.getString(R.string.exported));
|
||||
} catch (Exception e) {
|
||||
} catch (FileNotFoundException e) {
|
||||
ToastUtils.showToastInUiThread(c, MainApp.resources.getString(R.string.filenotfound) + " " + file);
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue