Small improvements

pull/174/head
M66B 5 years ago
parent f03a7d0335
commit 24a6a1fd8e

@ -67,9 +67,9 @@ public class EditTextCompose extends AppCompatEditText {
try {
if (id == android.R.id.paste) {
Context context = getContext();
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
if (clipboard.hasPrimaryClip()) {
ClipData.Item item = clipboard.getPrimaryClip().getItemAt(0);
ClipboardManager cbm = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
if (cbm != null && cbm.hasPrimaryClip()) {
ClipData.Item item = cbm.getPrimaryClip().getItemAt(0);
String html = item.getHtmlText();
if (html == null) {

@ -332,7 +332,7 @@ public class FragmentAnswer extends FragmentBase {
Uri uri = null;
ClipboardManager cbm = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
if (cbm.hasPrimaryClip()) {
if (cbm != null && cbm.hasPrimaryClip()) {
String link = cbm.getPrimaryClip().getItemAt(0).coerceToText(getContext()).toString();
uri = Uri.parse(link);
if (uri.getScheme() == null)
@ -345,7 +345,7 @@ public class FragmentAnswer extends FragmentBase {
FragmentDialogLink fragment = new FragmentDialogLink();
fragment.setArguments(args);
fragment.setTargetFragment(this, REQUEST_LINK);
fragment.show(getParentFragmentManager(), "compose:link");
fragment.show(getParentFragmentManager(), "answer:link");
return true;
} else

@ -1356,7 +1356,7 @@ public class FragmentCompose extends FragmentBase {
Uri uri = null;
ClipboardManager cbm = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
if (cbm.hasPrimaryClip()) {
if (cbm != null && cbm.hasPrimaryClip()) {
String link = cbm.getPrimaryClip().getItemAt(0).coerceToText(getContext()).toString();
uri = Uri.parse(link);
if (uri.getScheme() == null)

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_delete"
android:icon="@drawable/baseline_delete_24"

Loading…
Cancel
Save