I have no idea why that crashes for some people...

This commit is contained in:
Finnley Somdahl 2023-12-31 00:55:39 -06:00
parent 7dbf951d5a
commit 7228817c68

View file

@ -53,6 +53,7 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.google.android.material.internal.ViewUtils
import com.google.android.material.snackbar.Snackbar
import com.google.firebase.crashlytics.FirebaseCrashlytics
import kotlinx.coroutines.*
import nl.joery.animatedbottombar.AnimatedBottomBar
import java.io.*
@ -783,6 +784,7 @@ fun toast(string: String?) {
}
fun snackString(s: String?, activity: Activity? = null, clipboard: String? = null) {
try { //I have no idea why this sometimes crashes for some people...
if (s != null) {
(activity ?: currActivity())?.apply {
runOnUiThread {
@ -813,6 +815,10 @@ fun snackString(s: String?, activity: Activity? = null, clipboard: String? = nul
}
logger(s)
}
} catch (e: Exception) {
logger(e.stackTraceToString())
FirebaseCrashlytics.getInstance().recordException(e)
}
}
open class NoPaddingArrayAdapter<T>(context: Context, layoutId: Int, items: List<T>) :