Switch was added in the sdk level 14, not 11

Этот коммит содержится в:
Daniel Martí 2014-01-08 11:34:41 +01:00
родитель c274752477
Коммит 98d574afbf
2 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -326,7 +326,6 @@ public class DB {
private String cpuAbisDesc;
private boolean ignoreTouchscreen;
//@SuppressLint("NewApi")
public CompatibilityChecker(Context ctx) {
SharedPreferences prefs = PreferenceManager

Просмотреть файл

@ -17,8 +17,8 @@ public abstract class SwitchCompat extends Compatibility {
public abstract CompoundButton createSwitch();
public static SwitchCompat create(ManageRepo activity) {
if (hasApi(11)) {
return new HoneycombSwitch(activity);
if (hasApi(14)) {
return new IceCreamSwitch(activity);
} else {
return new OldSwitch(activity);
}
@ -26,10 +26,10 @@ public abstract class SwitchCompat extends Compatibility {
}
@TargetApi(11)
class HoneycombSwitch extends SwitchCompat {
@TargetApi(14)
class IceCreamSwitch extends SwitchCompat {
protected HoneycombSwitch(ManageRepo activity) {
protected IceCreamSwitch(ManageRepo activity) {
super(activity);
}