check contact app

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-11-05 15:54:12 +01:00 committed by Alper Öztürk
parent d5b1891439
commit 4039ffe0c9
2 changed files with 8 additions and 4 deletions

View file

@ -494,9 +494,13 @@ public class FileDetailSharingFragment extends Fragment implements ShareeListAda
} }
private void pickContactEmail() { private void pickContactEmail() {
Intent intent = new Intent(Intent.ACTION_PICK); Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Email.CONTENT_URI);
intent.setDataAndType(ContactsContract.Contacts.CONTENT_URI, ContactsContract.CommonDataKinds.Email.CONTENT_TYPE);
onContactSelectionResultLauncher.launch(intent); if (intent.resolveActivity(requireContext().getPackageManager()) != null) {
onContactSelectionResultLauncher.launch(intent);
} else {
DisplayUtils.showSnackMessage(requireActivity(), getString(R.string.file_detail_sharing_fragment_no_contact_app_message));
}
} }
private void handleContactResult(@NonNull Uri contactUri) { private void handleContactResult(@NonNull Uri contactUri) {

View file

@ -814,7 +814,7 @@
<string name="userinfo_no_info_text">Add name, picture and contact details on your profile page.</string> <string name="userinfo_no_info_text">Add name, picture and contact details on your profile page.</string>
<string name="drawer_header_background">Background image of drawer header</string> <string name="drawer_header_background">Background image of drawer header</string>
<string name="account_icon">Account icon</string> <string name="account_icon">Account icon</string>
<string name="file_detail_sharing_fragment_no_contact_app_message">No app available to select contacts</string>
<string name="end_to_end_encryption_folder_not_empty">This folder is not empty.</string> <string name="end_to_end_encryption_folder_not_empty">This folder is not empty.</string>
<string name="end_to_end_encryption_wrong_password">Error while decrypting. Wrong password?</string> <string name="end_to_end_encryption_wrong_password">Error while decrypting. Wrong password?</string>
<string name="end_to_end_encryption_decrypting">Decrypting…</string> <string name="end_to_end_encryption_decrypting">Decrypting…</string>