Use chooser

pull/175/head
M66B 5 years ago
parent 0d8ba072f2
commit fef33d591d

@ -229,7 +229,7 @@ public class ActivitySignature extends ActivityBase {
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.setType("image/*"); intent.setType("image/*");
Helper.openAdvanced(intent); Helper.openAdvanced(intent);
startActivityForResult(intent, REQUEST_IMAGE); startActivityForResult(Helper.getChooser(this, intent), REQUEST_IMAGE);
} }
private boolean onActionStyle(int action) { private boolean onActionStyle(int action) {

@ -1339,7 +1339,7 @@ public class FragmentCompose extends FragmentBase {
snackbar.show(); snackbar.show();
} else } else
try { try {
startActivityForResult(intent, REQUEST_RECORD_AUDIO); startActivityForResult(Helper.getChooser(getContext(), intent), REQUEST_RECORD_AUDIO);
} catch (SecurityException ex) { } catch (SecurityException ex) {
Log.w(ex); Log.w(ex);
Snackbar.make(view, getString(R.string.title_no_viewer, intent.getAction()), Snackbar.LENGTH_INDEFINITE).show(); Snackbar.make(view, getString(R.string.title_no_viewer, intent.getAction()), Snackbar.LENGTH_INDEFINITE).show();
@ -1368,7 +1368,7 @@ public class FragmentCompose extends FragmentBase {
try { try {
photoURI = FileProvider.getUriForFile(getContext(), BuildConfig.APPLICATION_ID, file); photoURI = FileProvider.getUriForFile(getContext(), BuildConfig.APPLICATION_ID, file);
intent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI); intent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
startActivityForResult(intent, REQUEST_TAKE_PHOTO); startActivityForResult(Helper.getChooser(getContext(), intent), REQUEST_TAKE_PHOTO);
} catch (SecurityException ex) { } catch (SecurityException ex) {
Log.w(ex); Log.w(ex);
Snackbar.make(view, getString(R.string.title_no_viewer, intent.getAction()), Snackbar.LENGTH_LONG).show(); Snackbar.make(view, getString(R.string.title_no_viewer, intent.getAction()), Snackbar.LENGTH_LONG).show();

@ -335,7 +335,7 @@ public class FragmentIdentity extends FragmentBase {
public void onClick(View v) { public void onClick(View v) {
Intent intent = new Intent(getContext(), ActivitySignature.class); Intent intent = new Intent(getContext(), ActivitySignature.class);
intent.putExtra("html", signature); intent.putExtra("html", signature);
startActivityForResult(intent, ActivitySetup.REQUEST_IDENITY_SIGNATURE); startActivityForResult(Helper.getChooser(getContext(), intent), ActivitySetup.REQUEST_IDENITY_SIGNATURE);
} }
}); });

Loading…
Cancel
Save