This commit is contained in:
viktoria 2016-07-04 01:04:35 +02:00
parent bb447d733d
commit 08e7a254de

View file

@ -1,5 +1,6 @@
package info.nightscout.utils; package info.nightscout.utils;
import android.Manifest;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
@ -25,10 +26,12 @@ import info.nightscout.androidaps.R;
/** /**
* Created by mike on 03.07.2016. * Created by mike on 03.07.2016.
*/ */
public class ImportExportPrefs { public class ImportExportPrefs {
static File path = new File(Environment.getExternalStorageDirectory().toString()); static File path = new File(Environment.getExternalStorageDirectory().toString());
static final File file = new File(path, MainApp.resources.getString(R.string.app_name) + "Preferences"); static final File file = new File(path, MainApp.resources.getString(R.string.app_name) + "Preferences");
//exports shared Preferences //exports shared Preferences
public static void exportSharedPreferences(final Context c) { public static void exportSharedPreferences(final Context c) {
@ -48,7 +51,10 @@ public class ImportExportPrefs {
pw.close(); pw.close();
fw.close(); fw.close();
ToastUtils.showToastInUiThread(c, MainApp.resources.getString(R.string.exported)); 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(); e.printStackTrace();
} }
} }