mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-02-16 03:10:38 +01:00
adding a crashfix to save as
This commit is contained in:
parent
4720ba6a4b
commit
faa427a493
@ -1,5 +1,6 @@
|
|||||||
package com.simplemobiletools.notes.dialogs
|
package com.simplemobiletools.notes.dialogs
|
||||||
|
|
||||||
|
import android.os.Environment
|
||||||
import android.support.v7.app.AlertDialog
|
import android.support.v7.app.AlertDialog
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
@ -14,7 +15,7 @@ import java.io.File
|
|||||||
class SaveAsDialog(val activity: SimpleActivity, val note: Note, val callback: (savePath: String) -> Unit) {
|
class SaveAsDialog(val activity: SimpleActivity, val note: Note, val callback: (savePath: String) -> Unit) {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
var realPath = File(note.path).parent
|
var realPath = File(note.path).parent ?: Environment.getExternalStorageDirectory().toString()
|
||||||
val view = LayoutInflater.from(activity).inflate(R.layout.dialog_save_as, null).apply {
|
val view = LayoutInflater.from(activity).inflate(R.layout.dialog_save_as, null).apply {
|
||||||
file_path.text = activity.humanizePath(realPath)
|
file_path.text = activity.humanizePath(realPath)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user