From 5614672234127315496b81c02d8d0f4d2a43e474 Mon Sep 17 00:00:00 2001 From: Bill Farmer Date: Sat, 22 Jul 2017 12:44:00 +0100 Subject: [PATCH] Add loading message --- src/main/java/org/billthefarmer/editor/Editor.java | 5 +++++ src/main/res/values/strings.xml | 1 + 2 files changed, 6 insertions(+) diff --git a/src/main/java/org/billthefarmer/editor/Editor.java b/src/main/java/org/billthefarmer/editor/Editor.java index b859ee6..ab32e80 100644 --- a/src/main/java/org/billthefarmer/editor/Editor.java +++ b/src/main/java/org/billthefarmer/editor/Editor.java @@ -249,6 +249,8 @@ private void readFile(Uri uri) String title = uri.getLastPathSegment(); setTitle(title); + textView.setText(R.string.loading); + path = uri.getPath(); file = new File(path); ReadTask read = new ReadTask(); @@ -292,6 +294,7 @@ private void write(String text, File file) fileWriter.write(text); fileWriter.close(); } + catch (Exception e) {} } @@ -331,6 +334,8 @@ protected void onProgressUpdate(Integer... progress) protected void onPostExecute(String result) { textView.setText(result); + dirty = false; + invalidateOptionsMenu(); } } } diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 9cf0d9c..177cdf7 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -5,6 +5,7 @@ Open file… Save + Loading… Text has been modified,\ndo you want to exit?