Skip to content
Snippets Groups Projects
Commit f19ce60d authored by Adrien Béraud's avatar Adrien Béraud
Browse files

navigation: fix crash in case no gallery app is available

Change-Id: Ie906b18f4e6894ec4e0329c6faacd0a2f203e061
parent 30146b40
No related branches found
No related tags found
No related merge requests found
...@@ -39,6 +39,7 @@ import android.widget.ImageView; ...@@ -39,6 +39,7 @@ import android.widget.ImageView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
...@@ -455,8 +456,12 @@ public class RingNavigationFragment extends BaseSupportFragment<RingNavigationPr ...@@ -455,8 +456,12 @@ public class RingNavigationFragment extends BaseSupportFragment<RingNavigationPr
@Override @Override
public void goToGallery() { public void goToGallery() {
try {
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI); Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, HomeActivity.REQUEST_CODE_GALLERY); startActivityForResult(intent, HomeActivity.REQUEST_CODE_GALLERY);
} catch (Exception e) {
Toast.makeText(requireContext(), R.string.gallery_error_message, Toast.LENGTH_SHORT).show();
}
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment