adding some crashfixes
This commit is contained in:
parent
80517444a4
commit
d52b4da80e
|
@ -134,17 +134,17 @@ class ThreadAdapter(activity: SimpleActivity, var messages: ArrayList<ThreadItem
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun copyToClipboard() {
|
private fun copyToClipboard() {
|
||||||
val firstItem = getSelectedItems().first() as? Message ?: return
|
val firstItem = getSelectedItems().firstOrNull() as? Message ?: return
|
||||||
activity.copyToClipboard(firstItem.body)
|
activity.copyToClipboard(firstItem.body)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun shareText() {
|
private fun shareText() {
|
||||||
val firstItem = getSelectedItems().first() as? Message ?: return
|
val firstItem = getSelectedItems().firstOrNull() as? Message ?: return
|
||||||
activity.shareTextIntent(firstItem.body)
|
activity.shareTextIntent(firstItem.body)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun selectText() {
|
private fun selectText() {
|
||||||
val firstItem = getSelectedItems().first() as? Message ?: return
|
val firstItem = getSelectedItems().firstOrNull() as? Message ?: return
|
||||||
if (firstItem.body.trim().isNotEmpty()) {
|
if (firstItem.body.trim().isNotEmpty()) {
|
||||||
SelectTextDialog(activity, firstItem.body)
|
SelectTextDialog(activity, firstItem.body)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue