kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
fix autobug for devices that don't have URL sharing support
rodzic
091b18a5bb
commit
7d898481a6
|
@ -1,5 +1,6 @@
|
||||||
package com.geeksville.mesh.ui
|
package com.geeksville.mesh.ui
|
||||||
|
|
||||||
|
import android.content.ActivityNotFoundException
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.graphics.ColorMatrix
|
import android.graphics.ColorMatrix
|
||||||
import android.graphics.ColorMatrixColorFilter
|
import android.graphics.ColorMatrixColorFilter
|
||||||
|
@ -143,8 +144,17 @@ class ChannelFragment : ScreenFragment("Channel"), Logging {
|
||||||
type = "text/plain"
|
type = "text/plain"
|
||||||
}
|
}
|
||||||
|
|
||||||
val shareIntent = Intent.createChooser(sendIntent, null)
|
try {
|
||||||
requireActivity().startActivity(shareIntent)
|
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()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,4 +102,5 @@
|
||||||
<string name="are_you_shure_change_default">Are you sure you want to change to the default channel?</string>
|
<string name="are_you_shure_change_default">Are you sure you want to change to the default channel?</string>
|
||||||
<string name="reset_to_defaults">Reset to defaults</string>
|
<string name="reset_to_defaults">Reset to defaults</string>
|
||||||
<string name="apply">Apply</string>
|
<string name="apply">Apply</string>
|
||||||
|
<string name="no_app_found">No application found to send URLs</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Ładowanie…
Reference in New Issue