mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-04-05 05:51:05 +02:00
Added invalid file format toast for import
This commit is contained in:
parent
1c554c33fe
commit
1309097d27
@ -8,6 +8,8 @@ import android.os.Bundle
|
|||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
|
import com.google.gson.JsonParseException
|
||||||
|
import com.google.gson.JsonSyntaxException
|
||||||
import com.google.gson.reflect.TypeToken
|
import com.google.gson.reflect.TypeToken
|
||||||
import com.simplemobiletools.commons.activities.ManageBlockedNumbersActivity
|
import com.simplemobiletools.commons.activities.ManageBlockedNumbersActivity
|
||||||
import com.simplemobiletools.commons.dialogs.ChangeDateTimeFormatDialog
|
import com.simplemobiletools.commons.dialogs.ChangeDateTimeFormatDialog
|
||||||
@ -312,6 +314,10 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
RecentsHelper(this).restoreRecentCalls(this, objects) {
|
RecentsHelper(this).restoreRecentCalls(this, objects) {
|
||||||
toast(R.string.importing_successful)
|
toast(R.string.importing_successful)
|
||||||
}
|
}
|
||||||
|
} catch (_: JsonParseException) {
|
||||||
|
toast(R.string.invalid_file_format)
|
||||||
|
} catch (_: JsonSyntaxException) {
|
||||||
|
toast(R.string.invalid_file_format)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
showErrorToast(e)
|
showErrorToast(e)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user