Fix set title on file open

This commit is contained in:
William Brawner 2018-01-16 00:07:29 +01:00 committed by William Brawner
parent be4099a6f4
commit f2b97e0f3a

View file

@ -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