fix: improve language settings #300

Merged
PeterCxy merged 1 commit from septs/OpenEUICC:language-intent into master 2026-02-24 00:23:53 +01:00
Collaborator

resolves #299 (may be)

resolves #299 (may be)
@ -53,1 +50,3 @@
}
val uri = Uri.fromParts("package", requireContext().packageName, null)
intent = Intent(Settings.ACTION_APP_LOCALE_SETTINGS, uri)
isVisible = intent!!.resolveActivity(requireContext().packageManager) != null
Author
Collaborator

Caution: If there are no apps on the device that can receive an implicit intent, an app crashes when it calls startActivity(). To first verify that an app exists to receive the intent, call resolveActivity() on your Intent object. If the result is non-null, there is at least one app that can handle the intent, and it's safe to call startActivity(). If the result is null, don't use the intent and, if possible, disable the feature that invokes the intent.

from https://developer.android.com/guide/components/intents-common?hl=en

> Caution: If there are no apps on the device that can receive an implicit intent, an app crashes when it calls startActivity(). To first verify that an app exists to receive the intent, call resolveActivity() on your Intent object. If the result is non-null, there is at least one app that can handle the intent, and it's safe to call startActivity(). If the result is null, don't use the intent and, if possible, disable the feature that invokes the intent. from <https://developer.android.com/guide/components/intents-common?hl=en>
PeterCxy merged commit 9496370135 into master 2026-02-24 00:23:53 +01:00
PeterCxy deleted branch language-intent 2026-02-24 00:23:54 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
PeterCxy/OpenEUICC!300
No description provided.