[Galaxy S II Android Development] remuntada78:
trying to solve it i added in my framework-res in res\value\attrs these lines

<attr name="switchTextAppearance1" format="reference" />
<attr name="switchTextAppearance2" format="reference" />
<attr name="switchMinWidth1" format="dimension" />
<attr name="switchMinWidth2" format="dimension" />
<attr name="switchPadding1" format="dimension" />
<attr name="switchPadding2" format="dimension" />
<attr name="thumbTextPadding1" format="dimension" />
<attr name="thumbTextPadding2" format="dimension" />

then in res\value\styles i added these red lines

<style name="Widget.Holo.CompoundButton.Switch" parent="@style/Widget.Holo.CompoundButton">
<item name="textOn">@string/capital_on</item>
<item name="textOff">@string/capital_off</item>
<item name="thumb">@drawable/switch_inner_holo_dark</item>[COLOR="Red"]
<item name="thumb1">@drawable/switch_inner_holo_dark</item>
<item name="thumb2">@drawable/switch_inner_holo_dark</item>[/COLOR]
<item name="switchTextAppearance">@style/TextAppearance.Holo.Widget.Switch</item>[COLOR="Red"]
<item name="switchTextAppearance1">@style/TextAppearance.Holo.Widget.Switch</item>
<item name="switchTextAppearance2">@style/TextAppearance.Holo.Widget.Switch</item>[/COLOR]
<item name="track">@drawable/switch_track_holo_dark</item>[COLOR="Red"]
<item name="track1">@drawable/switch_track_holo_dark</item>
<item name="track2">@drawable/switch_track_holo_dark</item>[/COLOR]
<item name="switchMinWidth">96.0dip</item>
<item name="switchPadding">16.0dip</item>
<item name="thumbTextPadding">12.0dip</item>[COLOR="Red"]
<item name="switchMinWidth1">96.0dip</item>
<item name="switchPadding1">16.0dip</item>
<item name="thumbTextPadding1">12.0dip</item>
<item name="switchMinWidth2">96.0dip</item>
<item name="switchPadding2">16.0dip</item>
<item name="thumbTextPadding2">12.0dip</item>[/COLOR]
</style>

then in my framework.jar in R$styleable.smali i changed ids in the array

:array_1018
.array-data 4
0x1010124 #textOn
0x1010125 #textOff
0x1010142 #thumb
0x101036e #switchTextAppearance
0x101036f #track
0x1010370 #switchMinWidth
0x1010371 #switchPadding
0x1010372 #thumbTextPadding
.end array-data

:array_google_switch
.array-data 4
0x1010124
0x1010125
0x1010476 #thumb1
0x101036e
0x1010477 #track1
0x1010370
0x1010371
0x1010372
.end array-data

:array_lg3_switch
.array-data 4
0x1010124
0x1010125
0x1010478 #thumb2
0x101036e
0x1010479 #track2
0x1010370
0x1010371
0x1010372
.end array-data

but when i choose different style i got this error

E/AndroidRuntime( 5508): FATAL EXCEPTION: main

E/AndroidRuntime( 5508): java.lang.NullPointerException

E/AndroidRuntime( 5508):	at android.widget.Switch.jumpDrawablesToCurrentState(Switch.java:1050)

it is refered to this code

.method public jumpDrawablesToCurrentState()V
.registers 2

.prologue
.line 1049
invoke-super {p0}, Landroid/widget/CompoundButton;->jumpDrawablesToCurrentState()V

.line 1050
iget-object v0, p0, Landroid/widget/Switch;->mThumbDrawable:Landroid/graphics/drawable/Drawable;

invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->jumpToCurrentState()V

.line 1051
iget-object v0, p0, Landroid/widget/Switch;->mTrackDrawable:Landroid/graphics/drawable/Drawable;

invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->jumpToCurrentState()V

.line 1052
return-void
.end method

the iput for mThumbDrawable:Landroid/graphics/drawable/Drawable; is (in red lines are my added code)

.line 200[COLOR="Red"]
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v1

const-string v2, "switch_button_style"

const/4 v3, 0x0

invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v1

const v2, 0x1

if-eq v1, v2, :cond_google

const v2, 0x2

if-eq v1, v2, :cond_lg3[/COLOR]

sget-object v6, Lcom/android/internal/R$styleable;->Switch:[I[COLOR="Red"]

goto :goto_new

:cond_google
sget-object v6, Lcom/android/internal/R$styleable;->Switch_google:[I

goto :goto_new

:cond_lg3
sget-object v6, Lcom/android/internal/R$styleable;->Switch_lg3:[I

:goto_new[/COLOR]
invoke-virtual {p1, p2, v6, p3, v7}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;

move-result-object v0

.line 203
.local v0, a:Landroid/content/res/TypedArray;
const/4 v6, 0x2

invoke-virtual {v0, v6}, Landroid/content/res/TypedArray;->getDrawable(I)Landroid/graphics/drawable/Drawable;

move-result-object v6

iput-object v6, p0, Landroid/widget/Switch;->mThumbDrawable:Landroid/graphics/drawable/Drawable;

.line 204

what i need to check?