私のカスタム設定クラスは、色の選択に役立ちます。
custom-preference は GridView Intent を呼び出します。これには 9 色が含まれます。
しかし、私のカスタムクラスは、グリッドビューでユーザーが選択した色を更新できません
。設定インテントを終了すると、設定を再起動すると、選択したとおりに
色が表示されます。
onBindView()メソッド、私はオーバーライドしました。パーフェクトだ。
しかし、色をリフレッシュするためにどのメソッドをオーバーライドする必要があるのか わかりません。

public class ConfigImage extends Preference
{
    Context mContext;
    public ConfigImage(Context context, AttributeSet attrs)
    {
        this(context, attrs, 0);
        this.mContext = context;
    }
    public ConfigImage(Context context, AttributeSet attrs, int defStyle)
    {
        super(context, attrs, defStyle);
        this.mContext = context;
        setLayoutResource(R.layout.preference_image);
    }
    @Override
    public void onBindView(View view)
    {
        super.onBindView(view);
        ImageView imageView = (ImageView) view.findViewById(R.id.preference_image_iv_color);
        if (imageView != null)
        {
            SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(mContext);
            int colorIndex = sharedPref.getInt("setting_color_default", 3);
            imageView.setBackgroundColor(Color.parseColor(ColorStorage.colors[colorIndex]));
        }
    }
}
.
    <PreferenceCategory
    android:key="setting_color_info"
    android:title="색상" >
    <com.pack.ConfigImage
        android:id="@+id/setting_color_default"
        android:key="setting_color_default"
        android:selectable="true"
        android:summary="Choose default color"
        android:title="Default Color"
        settings:background="#FFFFFFFF" />
</PreferenceCategory>