diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-10-20 13:55:56 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-10-20 13:55:56 +0200 |
commit | ee0e733754f99f3b654f8e0d60b9da2a7cf246b9 (patch) | |
tree | 061ba41698d64041a7d655c36ff9d2137c2d23dc /src/main/java/de/pixart/messenger/ui | |
parent | 3cdc753ecac1662caef89e23bf7ecd883d2db196 (diff) |
change apk icon
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java index 0dd5ffffa..788c8553e 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java @@ -408,10 +408,15 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie viewHolder.download_button.setText(add_contact); viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_account_card_details_grey600_48dp, 0, 0, 0); viewHolder.download_button.setOnClickListener(v -> { - Intent intent = new Intent(Intent.ACTION_VIEW); - intent.setData(Uri.parse(body)); - activity.startActivity(intent); - activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); + try { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(body)); + activity.startActivity(intent); + activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); + } catch (Exception e) { + Toast.makeText(activity, R.string.no_application_found_to_view_contact, Toast.LENGTH_LONG).show(); + } + }); viewHolder.image.setVisibility(View.GONE); viewHolder.messageBody.setVisibility(View.GONE); @@ -635,7 +640,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie e.printStackTrace(); } } - viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_file_grey600_48dp, 0, 0, 0); + viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_android_grey600_48dp, 0, 0, 0); viewHolder.download_button.setText(activity.getString(R.string.open_x_file, UIHelper.getFileDescriptionString(activity, message) + APKName)); } |