catch exception on broken android phones
This commit is contained in:
parent
558d065d48
commit
84bfe8c721
|
@ -3,6 +3,7 @@ package eu.siacs.conversations.ui;
|
|||
import android.app.AlertDialog;
|
||||
import android.app.Fragment;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
|
@ -513,7 +514,12 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
|||
}
|
||||
shareIntent.setType(mime);
|
||||
}
|
||||
try {
|
||||
activity.startActivity(Intent.createChooser(shareIntent, getText(R.string.share_with)));
|
||||
} catch (ActivityNotFoundException e) {
|
||||
//This should happen only on faulty androids because normally chooser is always available
|
||||
Toast.makeText(activity,R.string.no_application_found_to_open_file,Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
private void copyText(Message message) {
|
||||
|
|
Loading…
Reference in a new issue