mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
update commons to 2.12.2
This commit is contained in:
@ -33,7 +33,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.simplemobiletools:commons:2.8.8'
|
compile 'com.simplemobiletools:commons:2.12.2'
|
||||||
compile 'joda-time:joda-time:2.9.1'
|
compile 'joda-time:joda-time:2.9.1'
|
||||||
compile 'com.facebook.stetho:stetho:1.4.1'
|
compile 'com.facebook.stetho:stetho:1.4.1'
|
||||||
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
||||||
|
@ -246,34 +246,32 @@ class MainActivity : SimpleActivity(), NavigationListener {
|
|||||||
FilePickerDialog(this, pickFile = false) {
|
FilePickerDialog(this, pickFile = false) {
|
||||||
val source = getDatabasePath(DBHelper.DB_NAME)
|
val source = getDatabasePath(DBHelper.DB_NAME)
|
||||||
val destination = File(it, DBHelper.DB_NAME)
|
val destination = File(it, DBHelper.DB_NAME)
|
||||||
if (isShowingPermDialog(destination)) {
|
handleSAFDialog(destination) {
|
||||||
return@FilePickerDialog
|
Thread({
|
||||||
}
|
if (source.exists()) {
|
||||||
|
val inputStream = FileInputStream(source)
|
||||||
|
val outputStream: OutputStream?
|
||||||
|
|
||||||
Thread({
|
if (needsStupidWritePermissions(destination.absolutePath)) {
|
||||||
if (source.exists()) {
|
var document = getFileDocument(destination.absolutePath, config.treeUri) ?: return@Thread
|
||||||
val inputStream = FileInputStream(source)
|
if (!destination.exists()) {
|
||||||
val outputStream: OutputStream?
|
document = document.createFile("", destination.name)
|
||||||
|
}
|
||||||
if (needsStupidWritePermissions(destination.absolutePath)) {
|
outputStream = contentResolver.openOutputStream(document.uri)
|
||||||
var document = getFileDocument(destination.absolutePath, config.treeUri) ?: return@Thread
|
} else {
|
||||||
if (!destination.exists()) {
|
outputStream = FileOutputStream(destination)
|
||||||
document = document.createFile("", destination.name)
|
|
||||||
}
|
}
|
||||||
outputStream = contentResolver.openOutputStream(document.uri)
|
|
||||||
} else {
|
|
||||||
outputStream = FileOutputStream(destination)
|
|
||||||
}
|
|
||||||
|
|
||||||
copyStream(inputStream, outputStream)
|
copyStream(inputStream, outputStream)
|
||||||
inputStream.close()
|
inputStream.close()
|
||||||
outputStream?.close()
|
outputStream?.close()
|
||||||
|
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
toast(R.string.database_exported_successfully)
|
toast(R.string.database_exported_successfully)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}).start()
|
||||||
}).start()
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user