added error message
This commit is contained in:
parent
257b6b6c88
commit
cb3dcb8d6d
|
@ -199,12 +199,20 @@ class QuickSearchBarActivity : BaseActivity(), OnClickListener, LoaderCallbacks<
|
||||||
when (requestCode) {
|
when (requestCode) {
|
||||||
REQUEST_SCAN_QR -> {
|
REQUEST_SCAN_QR -> {
|
||||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||||
val scanResult = data.getStringExtra(EXTRA_ZXING_SCAN_RESULT)
|
val scanResult = data.getStringExtra(EXTRA_ZXING_SCAN_RESULT) ?: run {
|
||||||
|
Toast.makeText(this, R.string.message_toast_qr_scanner_not_supported,
|
||||||
|
Toast.LENGTH_SHORT).show()
|
||||||
|
return
|
||||||
|
}
|
||||||
val viewIntent = Intent(Intent.ACTION_VIEW, Uri.parse(scanResult)).apply {
|
val viewIntent = Intent(Intent.ACTION_VIEW, Uri.parse(scanResult)).apply {
|
||||||
`package` = BuildConfig.APPLICATION_ID
|
`package` = BuildConfig.APPLICATION_ID
|
||||||
putExtra(EXTRA_ACCOUNT_KEY, selectedAccountDetails?.key)
|
putExtra(EXTRA_ACCOUNT_KEY, selectedAccountDetails?.key)
|
||||||
}
|
}
|
||||||
val componentName = viewIntent.resolveActivity(packageManager) ?: return
|
val componentName = viewIntent.resolveActivity(packageManager) ?: run {
|
||||||
|
Toast.makeText(this, R.string.message_toast_qr_scan_link_not_supported,
|
||||||
|
Toast.LENGTH_SHORT).show()
|
||||||
|
return
|
||||||
|
}
|
||||||
viewIntent.component = componentName
|
viewIntent.component = componentName
|
||||||
startActivity(viewIntent)
|
startActivity(viewIntent)
|
||||||
finish()
|
finish()
|
||||||
|
|
|
@ -688,6 +688,8 @@
|
||||||
<string name="message_toast_notification_enabled_hint">Only available when streaming is on, and not 100% reliable.</string>
|
<string name="message_toast_notification_enabled_hint">Only available when streaming is on, and not 100% reliable.</string>
|
||||||
<string name="message_toast_press_again_to_close">Press again to close</string>
|
<string name="message_toast_press_again_to_close">Press again to close</string>
|
||||||
<string name="message_toast_profile_banner_image_updated">Profile banner image updated</string>
|
<string name="message_toast_profile_banner_image_updated">Profile banner image updated</string>
|
||||||
|
<string name="message_toast_qr_scan_link_not_supported">Link not supported</string>
|
||||||
|
<string name="message_toast_qr_scanner_not_supported">QR scanner not supported</string>
|
||||||
<string name="message_toast_retweet_cancelled">Retweet cancelled</string>
|
<string name="message_toast_retweet_cancelled">Retweet cancelled</string>
|
||||||
<string name="message_toast_save_media_no_storage_permission">Storage permission is needed to save media</string>
|
<string name="message_toast_save_media_no_storage_permission">Storage permission is needed to save media</string>
|
||||||
<string name="message_toast_saved_to_gallery">Saved to gallery</string>
|
<string name="message_toast_saved_to_gallery">Saved to gallery</string>
|
||||||
|
|
Loading…
Reference in New Issue