allow editing images with different apps too

This commit is contained in:
tibbi 2016-10-07 23:52:01 +02:00
parent a856a4a0f9
commit b2cea47c8d
8 changed files with 23 additions and 3 deletions

View file

@ -178,9 +178,15 @@ public class ViewPagerActivity extends SimpleActivity
}
private void openEditor() {
final Intent intent = new Intent(getApplicationContext(), EditActivity.class);
intent.setData(Uri.fromFile(getCurrentFile()));
startActivityForResult(intent, EDIT_IMAGE);
final Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setDataAndType(Uri.fromFile(getCurrentFile()), "image/*");
final Intent chooser = Intent.createChooser(intent, getString(R.string.edit_image_with));
if (intent.resolveActivity(getPackageManager()) != null) {
startActivityForResult(chooser, EDIT_IMAGE);
} else {
Utils.showToast(getApplicationContext(), R.string.no_editor_found);
}
}
@Override

View file

@ -50,6 +50,8 @@
<string name="image_croping_failed">Image croping failed:</string>
<string name="invalid_image_path">Invalid image path</string>
<string name="image_editing_failed">Image editing failed</string>
<string name="edit_image_with">Edit image with:</string>
<string name="no_editor_found">No image editor found</string>
<!-- About -->
<string name="about">Über</string>

View file

@ -50,6 +50,8 @@
<string name="image_croping_failed">Image croping failed:</string>
<string name="invalid_image_path">Invalid image path</string>
<string name="image_editing_failed">Image editing failed</string>
<string name="edit_image_with">Edit image with:</string>
<string name="no_editor_found">No image editor found</string>
<!-- About -->
<string name="about">Acerca de</string>

View file

@ -50,6 +50,8 @@
<string name="image_croping_failed">Image croping failed:</string>
<string name="invalid_image_path">Invalid image path</string>
<string name="image_editing_failed">Image editing failed</string>
<string name="edit_image_with">Edit image with:</string>
<string name="no_editor_found">No image editor found</string>
<!-- About -->
<string name="about">Informazioni</string>

View file

@ -50,6 +50,8 @@
<string name="image_croping_failed">Image croping failed:</string>
<string name="invalid_image_path">Invalid image path</string>
<string name="image_editing_failed">Image editing failed</string>
<string name="edit_image_with">Edit image with:</string>
<string name="no_editor_found">No image editor found</string>
<!-- About -->
<string name="about">アプリについて</string>

View file

@ -50,6 +50,8 @@
<string name="image_croping_failed">Image croping failed:</string>
<string name="invalid_image_path">Invalid image path</string>
<string name="image_editing_failed">Image editing failed</string>
<string name="edit_image_with">Edit image with:</string>
<string name="no_editor_found">No image editor found</string>
<!-- About -->
<string name="about">Sobre</string>

View file

@ -50,6 +50,8 @@
<string name="image_croping_failed">Image croping failed:</string>
<string name="invalid_image_path">Invalid image path</string>
<string name="image_editing_failed">Image editing failed</string>
<string name="edit_image_with">Edit image with:</string>
<string name="no_editor_found">No image editor found</string>
<!-- About -->
<string name="about">Om</string>

View file

@ -50,6 +50,8 @@
<string name="image_croping_failed">Image croping failed:</string>
<string name="invalid_image_path">Invalid image path</string>
<string name="image_editing_failed">Image editing failed</string>
<string name="edit_image_with">Edit image with:</string>
<string name="no_editor_found">No image editor found</string>
<!-- About -->
<string name="about">About</string>