Allow the framework to recycle ApnPreference views
BUG: 10079104 Change-Id: Iaa4f155da12a141f16300076cc820d47e0c5779a
This commit is contained in:
@@ -241,4 +241,8 @@
|
||||
|
||||
<!-- Scrollbar style OUTSIDE_OVERLAY -->
|
||||
<integer name="preference_scrollbar_style">33554432</integer>
|
||||
|
||||
<style name="ApnPreference">
|
||||
<item name="android:layout">@layout/apn_preference_layout</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
@@ -35,31 +35,16 @@ public class ApnPreference extends Preference implements
|
||||
CompoundButton.OnCheckedChangeListener, OnClickListener {
|
||||
final static String TAG = "ApnPreference";
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param attrs
|
||||
* @param defStyle
|
||||
*/
|
||||
public ApnPreference(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
init();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param attrs
|
||||
*/
|
||||
public ApnPreference(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init();
|
||||
this(context, attrs, R.style.ApnPreference);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
*/
|
||||
public ApnPreference(Context context) {
|
||||
super(context);
|
||||
init();
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
private static String mSelectedKey = null;
|
||||
@@ -99,10 +84,6 @@ public class ApnPreference extends Preference implements
|
||||
return view;
|
||||
}
|
||||
|
||||
private void init() {
|
||||
setLayoutResource(R.layout.apn_preference_layout);
|
||||
}
|
||||
|
||||
public boolean isChecked() {
|
||||
return getKey().equals(mSelectedKey);
|
||||
}
|
||||
|
Reference in New Issue
Block a user