mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-01-07 05:12:42 +01:00
handle exceptions thrown at using social media action buttons
This commit is contained in:
parent
16b81e6254
commit
251df880ff
@ -1,5 +1,6 @@
|
||||
package com.simplemobiletools.contacts.pro.activities
|
||||
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.ContentUris
|
||||
import android.content.Intent
|
||||
import android.media.AudioManager
|
||||
@ -681,7 +682,13 @@ class ViewContactActivity : ContactActivity() {
|
||||
val uri = ContentUris.withAppendedId(ContactsContract.Data.CONTENT_URI, action.dataId)
|
||||
setDataAndType(uri, action.mimetype)
|
||||
flags = Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||
startActivity(this)
|
||||
try {
|
||||
startActivity(this)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
toast(R.string.no_app_found)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user