OSDN Git Service

Prevent crash if weather settings activity can't be found
authorLuis Vidal <lvidal@cyngn.com>
Fri, 15 Apr 2016 17:11:36 +0000 (10:11 -0700)
committerLuis Vidal <lvidal@cyngn.com>
Fri, 15 Apr 2016 18:37:41 +0000 (11:37 -0700)
commitf1e42d8741c760433876b17a151b8b0cc2502b8b
tree93f7c0c8a6877fc57e3e88c326cfe2c195ff2283
parent791434fdc31f09821e703e89cd071000807bdf32
Prevent crash if weather settings activity can't be found

Each weather provider service may define a settings activity which
will be automatically launched when the user selects the provider.
If such activity can't be found, an ActivityNotFoundException is
thrown. This patch adds a try/catch block to avoid crashing the
settings app if the activity can't be found

A toast will be displayed to notify the user. Otherwise, the user
would never know why the settings gear is doing nothing

Change-Id: I3c3d54ce8f9131353077c34a2f821ec6b0fc0268
TICKET: CYNGNOS-2478
res/values/cm_strings.xml
src/com/android/settings/cyanogenmod/WeatherServiceSettings.java