Add safety net for when the user has disabled their contacts app.

fork-5.53.8
Alex Hart 2022-06-23 10:23:11 -03:00 zatwierdzone przez Cody Henthorne
rodzic 678a6f86ab
commit e85adad2b4
2 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -21,6 +21,7 @@ import android.animation.Animator;
import android.animation.LayoutTransition;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
@ -1810,7 +1811,12 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
@Override
protected void onPostExecute(Intent intent) {
startActivityForResult(intent, CODE_ADD_EDIT_CONTACT);
try {
startActivityForResult(intent, CODE_ADD_EDIT_CONTACT);
} catch (ActivityNotFoundException e) {
Log.w(TAG, "Could not locate contacts activity", e);
Toast.makeText(requireContext(), R.string.ConversationFragment__contacts_app_not_found, Toast.LENGTH_SHORT).show();
}
}
}.execute();
}

Wyświetl plik

@ -325,6 +325,8 @@
</plurals>
<!-- ConversationFragment -->
<!-- Toast text when contacts activity is not found -->
<string name="ConversationFragment__contacts_app_not_found">Contacts app not found.</string>
<plurals name="ConversationFragment_delete_selected_messages">
<item quantity="one">Delete selected message?</item>
<item quantity="other">Delete selected messages?</item>