diff options
Diffstat (limited to 'main/src/cgeo/geocaching')
| -rw-r--r-- | main/src/cgeo/geocaching/settings/SettingsActivity.java | 10 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/utils/ImageUtils.java | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/main/src/cgeo/geocaching/settings/SettingsActivity.java b/main/src/cgeo/geocaching/settings/SettingsActivity.java index 7b3f7fa..403b11d 100644 --- a/main/src/cgeo/geocaching/settings/SettingsActivity.java +++ b/main/src/cgeo/geocaching/settings/SettingsActivity.java @@ -93,9 +93,13 @@ public class SettingsActivity extends PreferenceActivity { if (gotoPage == INTENT_GOTO_SERVICES) { // start with services screen PreferenceScreen main = (PreferenceScreen) getPreference(R.string.pref_fakekey_main_screen); - if (main != null) { - int index = getPreference(R.string.pref_fakekey_services_screen).getOrder(); - main.onItemClick(null, null, index, 0); + try { + if (main != null) { + int index = getPreference(R.string.pref_fakekey_services_screen).getOrder(); + main.onItemClick(null, null, index, 0); + } + } catch (RuntimeException e) { + Log.e("could not open services preferences", e); } } } diff --git a/main/src/cgeo/geocaching/utils/ImageUtils.java b/main/src/cgeo/geocaching/utils/ImageUtils.java index 298b395..5286132 100644 --- a/main/src/cgeo/geocaching/utils/ImageUtils.java +++ b/main/src/cgeo/geocaching/utils/ImageUtils.java @@ -159,15 +159,12 @@ public final class ImageUtils { final int myMaxXY = Math.max(sizeOnlyOptions.outHeight, sizeOnlyOptions.outWidth); final int maxXY = Math.max(maxX, maxY); final int sampleSize = myMaxXY / maxXY; - Bitmap image; if (sampleSize > 1) { BitmapFactory.Options sampleOptions = new BitmapFactory.Options(); sampleOptions.inSampleSize = sampleSize; - image = BitmapFactory.decodeFile(filePath, sampleOptions); - } else { - image = BitmapFactory.decodeFile(filePath); + return BitmapFactory.decodeFile(filePath, sampleOptions); } - return image; + return BitmapFactory.decodeFile(filePath); } /** Create a File for saving an image or video |
