In my app exist my own class
public class ColorAccesoryView extends View{
@Override protected void onDraw(Canvas cv){
}
}
used in layout color_accesory.xml
<?xml version="1.0" encoding="utf-8"?>
<android.swp.ColorAccesoryView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/color_box"
android:layout_width="52dp"
android:layout_height="26dp"
android:gravity="right"
android:paddingRight="12dp" />
While PreferenceScreen create, I set this xml as a widget in two different preferences
color1_Pref.setWidgetLayoutResource(R.layout.color_accesory);
...
color2_Pref.setWidgetLayoutResource(R.layout.color_accesory);
How to get access to two instances of ColorAccesoryView to setup it for each preference separatelly?