Skip to content

Commit

Permalink
added toast to try-catch
Browse files Browse the repository at this point in the history
  • Loading branch information
r1walz committed Mar 23, 2018
1 parent d4d56ce commit b2d72e3
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.action_save:
try {
exportImage();
} catch (IOException ignored) {
} catch (IOException e) {
Toast.makeText(MainActivity.this,
"Storage access failed!",Toast.LENGTH_LONG).show();
}
break;
case R.id.action_about:
Expand Down Expand Up @@ -346,8 +348,9 @@ public void onRequestPermissionsResult(int requestCode,
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
try {
exportImage();
} catch (IOException ignored) {

} catch (IOException e) {
Toast.makeText(MainActivity.this,
"Storage access failed!",Toast.LENGTH_LONG).show();
}
} else {
Toast.makeText(this, "Storage access failed, check permission",
Expand Down

0 comments on commit b2d72e3

Please sign in to comment.