avoid stopping app in case of accessing empty db

When accessing empty database, Setting App is stopped, sometimes.
To avoid stopping app, check null for cursor

Change-Id: I71ec067f502d12a9215a9abdbe9e23fc07af17bb
This commit is contained in:
Hyejin Kim
2013-02-14 15:49:19 +09:00
committed by Sungmin Choi
parent bbe409d3ce
commit 88c80b10a2

View File

@@ -164,6 +164,7 @@ public class ApnSettings extends PreferenceActivity implements
"_id", "name", "apn", "type"}, where, null,
Telephony.Carriers.DEFAULT_SORT_ORDER);
if (cursor != null) {
PreferenceGroup apnList = (PreferenceGroup) findPreference("apn_list");
apnList.removeAll();
@@ -203,6 +204,7 @@ public class ApnSettings extends PreferenceActivity implements
apnList.addPreference(preference);
}
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {