From f2b97e0f3ae3a1e955599a28d776d258e3780ada Mon Sep 17 00:00:00 2001 From: Billy Brawner Date: Tue, 16 Jan 2018 00:07:29 +0100 Subject: [PATCH] Fix set title on file open --- .../simplemarkdown/view/activity/MainActivity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/view/activity/MainActivity.java b/app/src/main/java/com/wbrawner/simplemarkdown/view/activity/MainActivity.java index e86fb8f..acaecc6 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/view/activity/MainActivity.java +++ b/app/src/main/java/com/wbrawner/simplemarkdown/view/activity/MainActivity.java @@ -259,7 +259,12 @@ public class MainActivity extends AppCompatActivity break; } - presenter.loadMarkdown((File) data.getSerializableExtra(EXTRA_FILE)); + File markdownFile = (File) data.getSerializableExtra(EXTRA_FILE); + presenter.loadMarkdown(markdownFile); + String title = markdownFile.getName(); + if (!title.isEmpty()) { + setTitle(title); + } break; case SAVE_FILE_REQUEST: if (resultCode != RESULT_OK