mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-10-11 21:42:18 -04:00
fix autobug for devices that don't have URL sharing support
This commit is contained in:
1 parent
091b18a5bb
commit
7d898481a6
2 files changed
+13
-2
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package com.geeksville.mesh.ui
|
||||
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Intent
|
||||
import android.graphics.ColorMatrix
|
||||
import android.graphics.ColorMatrixColorFilter
|
||||
@@ -143,8 +144,17 @@ class ChannelFragment : ScreenFragment("Channel"), Logging {
|
||||
type = "text/plain"
|
||||
}
|
||||
|
||||
val shareIntent = Intent.createChooser(sendIntent, null)
|
||||
requireActivity().startActivity(shareIntent)
|
||||
try {
|
||||
val shareIntent = Intent.createChooser(sendIntent, null)
|
||||
requireActivity().startActivity(shareIntent)
|
||||
}
|
||||
catch(ex: ActivityNotFoundException) {
|
||||
Snackbar.make(
|
||||
binding.shareButton,
|
||||
R.string.no_app_found,
|
||||
Snackbar.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user